Re:Having fun with Go's nil, interfaces and errors
by catnaroek on Saturday September 17, 2016 @02:33PM
(#12521741)
Most likely the reason is keeping the language implementation simple. Java-style `null` is actually quite subtle: http://stackoverflow.com/a/2707333/46571
[ Parent
| on HN ]
Re:Having fun with Go's nil, interfaces and errors
by pcwalton on Saturday September 17, 2016 @05:29PM
(#12522556)
Go has the same complexity. From the Go spec: "For an expression x of interface type and a type T, the primary expression x.(T) asserts that x is not nil and that the value stored in x is of type T.'"