Explorar o código

doc(recovery): add RecoveryWithWriter doc (#1097)

Eason Lin %!s(int64=8) %!d(string=hai) anos
pai
achega
848fa41ca0
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      recovery.go

+ 1 - 0
recovery.go

@@ -26,6 +26,7 @@ func Recovery() HandlerFunc {
 	return RecoveryWithWriter(DefaultErrorWriter)
 }
 
+// RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
 func RecoveryWithWriter(out io.Writer) HandlerFunc {
 	var logger *log.Logger
 	if out != nil {