In Go1 (to be specific, revision
gob package returns an error if one tries to encode a nil value loosely speaking.
Excluding channels and functions (which cannot be serialized), nil values can be assumed by slices, maps, pointers and interfaces. Nil values, in the case of slices and maps, linguistically behave like empty slices and empty maps, respectively, which is perhaps why the gob package can, in fact, encode and decode those correctly.
On the other hand, it returns an error if one tries to encode a nil pointer or a nil interface. (Here, a nil interface is either an interface which has no type and no value, or an interface that has a type and a nil value.)
Oddly, there are some other quirks. Gob refuses to encode a slice of pointers, if any element in the slice is nil. However, it does not refuse to encode a struct that has pointer fields that are nil.