1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:04:40 -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:
Russ Cox 2016-10-20 15:08:40 -04:00
parent 59b0e14760
commit 4b9490ee72

View File

@ -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