docs: additional comments

This commit is contained in:
Daniel G. Taylor 2020-09-29 14:19:22 -07:00
parent 5c4ae17766
commit b46f0413e5
No known key found for this signature in database
GPG key ID: 7BD6DC99C9A87E22

View file

@ -91,7 +91,8 @@ func Recovery(onPanic PanicFunc) func(http.Handler) http.Handler {
}
// Recovering comes *after* the above so the buffer is not returned to
// the pool until after we print out its contents.
// the pool until after we print out its contents. This deferred func
// is used to recover from panics and deliberately left in-line.
defer func() {
if err := recover(); err != nil {
// The body might have been read or partially read, so replace it