• Rob Pike's avatar
    encoding/gob: document the extra byte after a singleton · 67a46cc1
    Rob Pike authored
    This paragraph has been added, as the notion was missing from the
    documentation.
    
    If a value is passed to Encode and the type is not a struct (or pointer to struct,
    etc.), for simplicity of processing it is represented as a struct of one field.
    The only visible effect of this is to encode a zero byte after the value, just as
    after the last field of an encoded struct, so that the decode algorithm knows when
    the top-level value is complete.
    
    Fixes #16978
    
    Change-Id: I5f008e792d1b6fe80d2e026a7ff716608889db32
    Reviewed-on: https://go-review.googlesource.com/38414Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    67a46cc1
Name
Last commit
Last update
..
codec_test.go Loading commit data...
debug.go Loading commit data...
dec_helpers.go Loading commit data...
decgen.go Loading commit data...
decode.go Loading commit data...
decoder.go Loading commit data...
doc.go Loading commit data...
dump.go Loading commit data...
enc_helpers.go Loading commit data...
encgen.go Loading commit data...
encode.go Loading commit data...
encoder.go Loading commit data...
encoder_test.go Loading commit data...
error.go Loading commit data...
example_encdec_test.go Loading commit data...
example_interface_test.go Loading commit data...
example_test.go Loading commit data...
gobencdec_test.go Loading commit data...
timing_test.go Loading commit data...
type.go Loading commit data...
type_test.go Loading commit data...