• Rob Pike's avatar
    encoding/gob: document behavior of zero-valued arrays, slices, and maps · 148b13c3
    Rob Pike authored
    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/17394Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    148b13c3
Name
Last commit
Last update
..
ascii85 Loading commit data...
asn1 Loading commit data...
base32 Loading commit data...
base64 Loading commit data...
binary Loading commit data...
csv Loading commit data...
gob Loading commit data...
hex Loading commit data...
json Loading commit data...
pem Loading commit data...
xml Loading commit data...
encoding.go Loading commit data...