1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00
go/src/encoding/gob
Rob Pike 148b13c3bb encoding/gob: document behavior of zero-valued arrays, slices, and maps
The documentation was inconsistent. It said zero values were not sent, but
that zero-valued elements of arrays and arrays were sent. But which rule
applies if the array is all zero elements, and is therefore itself a zero value?

The answer is: the array is transmitted. In principle the other choice could
be made, but there would be considerable expense and complexity required
to implement this behavior now, not to mention worries about changes of
behavior.

Therefore we just document the situation: Arrays, slices, and maps are
always encoded. It would perhaps be nice to have sorted this out earlier,
but it was a missed opportunity.

Fixes #13378

Change-Id: I8fae345edfa707fcfa7a3e0160d87ff1ac5cc5a2
Reviewed-on: https://go-review.googlesource.com/17394
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-07 20:41:31 +00:00
..
codec_test.go encoding/gob: reduce the amount of memory allocations. 2015-11-25 17:01:25 +00:00
debug.go
dec_helpers.go encoding/gob: reduce the amount of memory allocations. 2015-11-25 17:01:25 +00:00
decgen.go encoding/gob: reduce the amount of memory allocations. 2015-11-25 17:01:25 +00:00
decode.go encoding/gob: reduce the amount of memory allocations. 2015-11-25 17:01:25 +00:00
decoder.go encoding/gob: add custom decoder buffer for performance 2014-10-20 07:33:08 -07:00
doc.go encoding/gob: document behavior of zero-valued arrays, slices, and maps 2015-12-07 20:41:31 +00:00
dump.go
enc_helpers.go encoding/gob: custom array/slice decoders 2014-10-17 12:37:41 -07:00
encgen.go encoding/gob: custom array/slice decoders 2014-10-17 12:37:41 -07:00
encode.go encoding/gob: reduce the amount of memory allocations. 2015-11-25 17:01:25 +00:00
encoder_test.go encoding/gob: reduce the amount of memory allocations. 2015-11-25 17:01:25 +00:00
encoder.go encoding/gob: add "too big" check when writing a message 2015-05-12 17:52:39 +00:00
error.go
example_encdec_test.go
example_interface_test.go
example_test.go
gobencdec_test.go
timing_test.go encoding/gob: reduce the amount of memory allocations. 2015-11-25 17:01:25 +00:00
type_test.go
type.go encoding/gob: fix typo in documentation 2015-10-06 15:13:43 +00:00