News for hackers. Stuff that matters.
Re:Having fun with Go's nil, interfaces and errors by kjksf on Saturday September 17, 2016 @04:58PM (#12522424)
In Go, it's called "zero value", not "nil value".

It's also not an implicit conversion from nil to something. Nil isn't a value the way 0 is a value of an integer or "foo" is a value of string.

Per Go spec (https://golang.org/ref/spec) nil is "predeclared identifier which has no type". That implies it doesn't have a value and therefore cannot be converted to a value.

Nil is zero value of pointer types (which in practice end up being a pointer whose value interpreted as integer is 0) and also a zero value of interface type (which is interface without a type and without a value) and a few other types.

There are no comments on this comment yet.