Skip to content

Commit f081266

Browse files
committed
encoding/binary: clarify the repercussions for not following the docs
Fixes #19794 Change-Id: I462cbc432fe9d4a9e6e79a9833b0013d82a0780e Reviewed-on: https://go-review.googlesource.com/47093 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 070b82e commit f081266

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/encoding/binary/binary.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ func (bigEndian) GoString() string { return "binary.BigEndian" }
152152
// When reading into structs, the field data for fields with
153153
// blank (_) field names is skipped; i.e., blank field names
154154
// may be used for padding.
155-
// When reading into a struct, all non-blank fields must be exported.
155+
// When reading into a struct, all non-blank fields must be exported
156+
// or Read may panic.
156157
//
157158
// The error is EOF only if no bytes were read.
158159
// If an EOF happens after reading some but not all the bytes,

0 commit comments

Comments
 (0)