]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: better error messages when types mismatch
authorRob Pike <r@golang.org>
Wed, 14 Dec 2011 04:40:55 +0000 (20:40 -0800)
committerRob Pike <r@golang.org>
Wed, 14 Dec 2011 04:40:55 +0000 (20:40 -0800)
commitba576b2b4821df758a39202120f9473153c3b3a6
tree67ccc53d60c4afeb7dbe80370ed6021143e7749a
parent1c50c32af07047e2df0cac7fa1e56fed33649e31
encoding/gob: better error messages when types mismatch
The transmitter must encode an interface value if it is to be decoded
into an interface value, but it's a common and confusing error to
encode a concrete value and attempt to decode it into an interface,
particularly *interface{}. This CL attempts to explain things better.

Fixes #2367.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5485072
src/pkg/encoding/gob/decode.go
src/pkg/encoding/gob/encoder_test.go