]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: document Encode, EncodeValue nil pointer panics
authorEmmanuel Odeke <emm.odeke@gmail.com>
Sun, 3 Jul 2016 21:57:35 +0000 (14:57 -0700)
committerAndrew Gerrand <adg@golang.org>
Tue, 5 Jul 2016 06:36:21 +0000 (06:36 +0000)
commit5a9d5c37479231336efef0e0fa5b75645aa1c569
tree2949fb912a6a0fb13f77ff98d9cddced2e89e5b4
parent003a68bc7fcb917b5a4d92a5c2244bb1adf8f690
encoding/gob: document Encode, EncodeValue nil pointer panics

Fixes #16258.

Docs for Encode and EncodeValue do not mention that
nil pointers are not permitted hence we panic,
because Gobs encode values yet nil pointers have no value
to encode. It moves a comment that was internal to EncodeValue
to the top level to make it clearer to users what to expect
when they pass in nil pointers.
Supplements test TestTopLevelNilPointer.

Change-Id: Ie54f609fde4b791605960e088456047eb9aa8738
Reviewed-on: https://go-review.googlesource.com/24740
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/gob/doc.go
src/encoding/gob/encoder.go
src/encoding/gob/encoder_test.go