Skip to content

Commit

Permalink
Avoid "magic" number in exit(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
arielshaqed committed Nov 19, 2020
1 parent f1759c3 commit db02f63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/lakefs/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ var initCmd = &cobra.Command{
},
}

const internalErrorCode = 2

//nolint:gochecknoinits
func init() {
rootCmd.AddCommand(initCmd)
Expand All @@ -85,12 +87,12 @@ func init() {
if err := f.MarkHidden("access-key-id"); err != nil {
// (internal error)
fmt.Fprint(os.Stderr, err)
os.Exit(2)
os.Exit(internalErrorCode)
}
if err := f.MarkHidden("secret-access-key"); err != nil {
// (internal error)
fmt.Fprint(os.Stderr, err)
os.Exit(2)
os.Exit(internalErrorCode)
}
_ = initCmd.MarkFlagRequired("user-name")
}

0 comments on commit db02f63

Please sign in to comment.