@@ -19,6 +19,32 @@ func (b *builder) buildExits(fn *Function) {
19
19
fn .NoReturn = AlwaysUnwinds
20
20
return
21
21
}
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
+ }
22
48
case "github.com/sirupsen/logrus" :
23
49
switch obj .(* types.Func ).FullName () {
24
50
case "(*github.com/sirupsen/logrus.Logger).Exit" :
0 commit comments