]> Cypherpunks repositories - gostls13.git/commitdiff
fmt: document that if String or Error panics, that value is printed
authorIan Lance Taylor <iant@golang.org>
Mon, 29 Apr 2013 19:01:32 +0000 (12:01 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 29 Apr 2013 19:01:32 +0000 (12:01 -0700)
Fixes #5350.

R=r, minux.ma
CC=golang-dev
https://golang.org/cl/8950043

src/pkg/fmt/doc.go

index 3cd02d7ede45d575257c42909ba7158d24efff82..b8dd995c77b88529e0246e39bd0310ab2a0bf579 100644 (file)
        by a single character (the verb) and end with a parenthesized
        description.
 
+       If an Error or String method triggers a panic when called by a
+       print routine, the fmt package reformats the error message
+       from the panic, decorating it with an indication that it came
+       through the fmt package.  For example, if a String method
+       calls panic("bad"), the resulting formatted message will look
+       like
+               %s(PANIC=bad)
+
+       The %s just shows the print verb in use when the failure
+       occurred.
 
        Scanning