Skip to content

Commit

Permalink
Panic when logger was not initialized on root command.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Aug 24, 2023
1 parent 16992d5 commit fb3aac2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ var waitCmd = &cobra.Command{

func main() {
if err := rootCmd.Execute(); err != nil {
if logger == nil {
panic(err)
}
logger.Fatalw("failed executing root command", "error", err)
}
}
Expand Down

0 comments on commit fb3aac2

Please sign in to comment.