Skip to content

Commit

Permalink
Add logutil.Fatal to forbidden functions list
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Apr 29, 2024
1 parent 6fe7147 commit e549436
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ linters-settings:
msg: use ee/allowedcmd functions instead
- p: ^os\.Exit.*$
msg: do not use os.Exit so that launcher can shut down gracefully
- p: ^logutil\.Fatal.*$
msg: do not use logutil.Fatal so that launcher can shut down gracefully
sloglint:
kv-only: true
context-only: true
Expand Down
6 changes: 3 additions & 3 deletions cmd/make/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {

if err := ff.Parse(fs, os.Args[1:], ffOpts...); err != nil {
logger := logutil.NewCLILogger(true)
logutil.Fatal(logger, "msg", "Error parsing flags", "err", err)
logutil.Fatal(logger, "msg", "Error parsing flags", "err", err) //nolint:forbidigo // Fine to use logutil.Fatal outside of launcher proper
}

logger := logutil.NewCLILogger(*flDebug)
Expand Down Expand Up @@ -98,10 +98,10 @@ func main() {
if fn, ok := targetSet[target]; ok {
level.Debug(logger).Log("msg", "calling target", "target", target)
if err := fn(ctx); err != nil {
logutil.Fatal(logger, "msg", "Target Failed", "err", err, "target", target)
logutil.Fatal(logger, "msg", "Target Failed", "err", err, "target", target) //nolint:forbidigo // Fine to use logutil.Fatal outside of launcher proper
}
} else {
logutil.Fatal(logger, "err", "target does not exist", "target", target)
logutil.Fatal(logger, "err", "target does not exist", "target", target) //nolint:forbidigo // Fine to use logutil.Fatal outside of launcher proper
}
}
}
Expand Down

0 comments on commit e549436

Please sign in to comment.