1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:50:21 -07:00

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
This commit is contained in:
Ian Lance Taylor 2013-04-29 12:01:32 -07:00
parent 13721cf688
commit 806dea82d4

View File

@ -138,6 +138,16 @@
by a single character (the verb) and end with a parenthesized by a single character (the verb) and end with a parenthesized
description. 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 Scanning