From b790ad5ac0c9f2cc20ded07162e539702b1b029f Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 24 Nov 2015 10:32:37 -0800 Subject: [PATCH] encoding/gob: document that zero elements of arrays and slices are sent Fixes #13378 Change-Id: Ia78624ca1aa36ee906cef15416ea5554fa8229f2 Reviewed-on: https://go-review.googlesource.com/17201 Reviewed-by: Ian Lance Taylor --- src/encoding/gob/doc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/encoding/gob/doc.go b/src/encoding/gob/doc.go index 481c7572d9..18a91bd7ad 100644 --- a/src/encoding/gob/doc.go +++ b/src/encoding/gob/doc.go @@ -140,7 +140,8 @@ Strings and slices of bytes are sent as an unsigned count followed by that many uninterpreted bytes of the value. All other slices and arrays are sent as an unsigned count followed by that many -elements using the standard gob encoding for their type, recursively. +elements using the standard gob encoding for their type, recursively. In slices +and arrays, elements with the zero value are transmitted. Maps are sent as an unsigned count followed by that many key, element pairs. Empty but non-nil maps are sent, so if the receiver has not allocated -- 2.48.1