6 ms·
But: http://play.golang.org/p/J46-8OEWYS http://play.golang.org/p/J46-8OEWYS
by _ak 13y ago
But: http://play.golang.org/p/J46-8OEWYS http://play.golang.org/p/J46-8OEWYS
- eonil 13y agoThis is even more interesting.
- cgearhart 13y ago`make` allocates and initializes `a`, setting it to nil effectively uninitializes the variable. See below, where I declare `c`, but don't initialize it. From the Golang spec, http://golang.org/ref/spec#Map_types http://golang.org/ref/spec#Map_types, the value of an uninitialized map is nil. http://play.golang.org/p/J46-8OEWYS http://play.golang.org/p/J46-8OEWYS
- _ak 13y agoDon't tell me, I merely added one line of code to show that more information than the interface{} being nil is kept.