mirror of
https://github.com/golang/go
synced 2024-11-24 03:40:16 -07:00
fmt: document that unexported struct fields don't get the String/Error treatment
Fixes #17409. Change-Id: Ib49ff4a467431b5c1e6637e5144979cf0bfba489 Reviewed-on: https://go-review.googlesource.com/31817 Reviewed-by: Martin Möhrmann <martisch@uos.de> Reviewed-by: Quentin Smith <quentin@golang.org>
This commit is contained in:
parent
59b0e14760
commit
4b9490ee72
@ -174,6 +174,9 @@
|
||||
that type has a String method. Such pathologies are rare, however,
|
||||
and the package does not protect against them.
|
||||
|
||||
When printing a struct, fmt cannot and therefore does not invoke
|
||||
formatting methods such as Error or String on unexported fields.
|
||||
|
||||
Explicit argument indexes:
|
||||
|
||||
In Printf, Sprintf, and Fprintf, the default behavior is for each
|
||||
|
Loading…
Reference in New Issue
Block a user