@@ -19,6 +19,32 @@ func (b *builder) buildExits(fn *Function) {
1919 fn .NoReturn = AlwaysUnwinds
2020 return
2121 }
22+ case "go.uber.org/zap" :
23+ switch obj .(* types.Func ).FullName () {
24+ case "(*go.uber.org/zap.Logger).Fatal" ,
25+ "(*go.uber.org/zap.SugaredLogger).Fatal" ,
26+ "(*go.uber.org/zap.SugaredLogger).Fatalw" ,
27+ "(*go.uber.org/zap.SugaredLogger).Fatalf" :
28+ // Technically, this method does not unconditionally exit
29+ // the process. It dynamically calls a function stored in
30+ // the logger. If the function is nil, it defaults to
31+ // os.Exit.
32+ //
33+ // The main intent of this method is to terminate the
34+ // process, and that's what the vast majority of people
35+ // will use it for. We'll happily accept some false
36+ // negatives to avoid a lot of false positives.
37+ fn .NoReturn = AlwaysExits
38+ case "(*go.uber.org/zap.Logger).Panic" ,
39+ "(*go.uber.org/zap.SugaredLogger).Panicw" ,
40+ "(*go.uber.org/zap.SugaredLogger).Panicf" :
41+ fn .NoReturn = AlwaysUnwinds
42+ return
43+ case "(*go.uber.org/zap.Logger).DPanic" ,
44+ "(*go.uber.org/zap.SugaredLogger).DPanicf" ,
45+ "(*go.uber.org/zap.SugaredLogger).DPanicw" :
46+ // These methods will only panic in development.
47+ }
2248 case "github.com/sirupsen/logrus" :
2349 switch obj .(* types.Func ).FullName () {
2450 case "(*github.com/sirupsen/logrus.Logger).Exit" :
0 commit comments