Unfortunately, the PanicAndRecover post does not cover this specific 
guidance, that panic recovery should only be used for known panics that are 
owned and controlled by the program or library itself. As a result, the 
Google style guide is the closest thing we have to an official public 
document that shortly covers this behavior.

On Monday, December 8, 2025 at 9:35:59 PM UTC-3 Ian Lance Taylor wrote:

> On Mon, Dec 8, 2025 at 3:24 PM Max Claus <[email protected]> wrote:
> >
> > Thanks, Ian, this is very helpful.
> >
> > I’ll open an issue in the Go repository suggesting that the net/http 
> documentation be made more explicit: although the HTTP server has built-in 
> panic recovery, it should not be treated as a best practice pattern. The 
> general guidance should be to let unexpected panics crash the program, 
> unless explicitly recovering from a panic you triggered and fully 
> understand.
> >
> > Do you know if there is an official Go document that states this 
> clearly? It seems like an important detail to have in formal documentation 
> rather than buried in discussion threads, which can be harder to find and 
> consume.
>
> I think the clearest statement of what we consider to be good Go style
> may be https://go.dev/wiki/PanicAndRecover.
>
> You also already mentioned the Google Go style guide.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/1ac53f36-4601-475d-8136-bed92179a4d4n%40googlegroups.com.

Reply via email to