Skip to content

Commit

Permalink
Errcheck logger
Browse files Browse the repository at this point in the history
  • Loading branch information
krzko committed Jul 26, 2022
1 parent 6c23376 commit e9bbd58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ func initLogger(c *cli.Context) error {
cfg = zap.NewProductionConfig()
}
logger, err = cfg.Build()

defer logger.Sync()
if err != nil {
panic(err)
}

defer logger.Sync()

return err
}

Expand Down
1 change: 0 additions & 1 deletion internal/cli/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ func genTracesCommand() *cli.Command {
},
Action: func(c *cli.Context) error {
var err error
defer logger.Sync()

if c.String("otel-exporter-otlp-endpoint") == "" {
return errors.New("'otel-exporter-otlp-endpoint' must be set")
Expand Down

0 comments on commit e9bbd58

Please sign in to comment.