From: Ian Lance Taylor Date: Mon, 29 Apr 2013 19:01:32 +0000 (-0700) Subject: fmt: document that if String or Error panics, that value is printed X-Git-Tag: go1.1rc2~40 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=806dea82d4668c079856b77b3824143500405d25;p=gostls13.git fmt: document that if String or Error panics, that value is printed Fixes #5350. R=r, minux.ma CC=golang-dev https://golang.org/cl/8950043 --- diff --git a/src/pkg/fmt/doc.go b/src/pkg/fmt/doc.go index 3cd02d7ede..b8dd995c77 100644 --- a/src/pkg/fmt/doc.go +++ b/src/pkg/fmt/doc.go @@ -138,6 +138,16 @@ 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