Browse Source

fix golint issues in core/rescue (#508)

Kevin Wan 4 years ago
parent
commit
90562df826
1 changed files with 3 additions and 0 deletions
  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()