You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fmt package and other packages that transitively use it (html/template and
text/template in particular) have surprising behavior when the "String()
string" method panics.
I would expect the panic to continue to propagate back to the caller. But it appears
that fmt.Sprint silently converts panics into strings of the form
"%v(PANIC=%s)". This behavior is not documented in the fmt, html/template, or
text/template packages.
This leads to cases where non-trivial programs deadlock when one would otherwise expect
a crash with useful stack traces:
http://play.golang.org/p/G9ytQr6EPs
Ideally, the fmt package should not recover any panics at all.
If that's not feasible (e.g. for reasons of backward-compatibility), then at the very
least the behavior of packages that (transitively) use it should be documented.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: