Sfoglia il codice sorgente

fix golint issues in core/rescue (#508)

Kevin Wan 5 anni fa
parent
commit
90562df826
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      core/rescue/recover.go

+ 3 - 0
core/rescue/recover.go

@@ -2,6 +2,9 @@ package rescue
 
 import "github.com/tal-tech/go-zero/core/logx"
 
+// Recover is used with defer to do cleanup on panics.
+// Use it like:
+//  defer Recover(func() {})
 func Recover(cleanups ...func()) {
 	for _, cleanup := range cleanups {
 		cleanup()