]> Cypherpunks repositories - gostls13.git/commitdiff
fmt: document that unexported struct fields don't get the String/Error treatment
authorRuss Cox <rsc@golang.org>
Thu, 20 Oct 2016 19:08:40 +0000 (15:08 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 26 Oct 2016 13:56:45 +0000 (13:56 +0000)
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>
src/fmt/doc.go

index f8ae4e72f9870ff7868d8d87135dd731c457e44b..a2faecb36e1e3f67a04629bfc8af4210d1d4acae 100644 (file)
        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