Skip to content

Commit

Permalink
fmt: document that if String or Error panics, that value is printed
Browse files Browse the repository at this point in the history
Fixes #5350.

R=r, minux.ma
CC=golang-dev
https://golang.org/cl/8950043
  • Loading branch information
ianlancetaylor committed Apr 29, 2013
1 parent 13721cf commit 806dea8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pkg/fmt/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 806dea8

Please sign in to comment.