Skip to content

Commit

Permalink
annotate with nolint:errcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Dec 10, 2024
1 parent 114c12e commit 13070ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions cmd/root/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ func initOutputFlag(cmd *cobra.Command) *outputFlag {
// Configure defaults from environment, if applicable.
// If the provided value is invalid it is ignored.
if v, ok := env.Lookup(cmd.Context(), envOutputFormat); ok {
// QQQ log the error?
_ = f.output.Set(v)
f.output.Set(v) //nolint:errcheck
}

cmd.PersistentFlags().VarP(&f.output, "output", "o", "output type: text or json")
Expand Down
7 changes: 3 additions & 4 deletions cmd/root/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,13 @@ func initLogFlags(cmd *cobra.Command) *logFlags {
// Configure defaults from environment, if applicable.
// If the provided value is invalid it is ignored.
if v, ok := env.Lookup(cmd.Context(), envLogFile); ok {
// QQQ log the error? here and below
_ = f.file.Set(v)
f.file.Set(v) //nolint:errcheck
}
if v, ok := env.Lookup(cmd.Context(), envLogLevel); ok {
_ = f.level.Set(v)
f.level.Set(v) //nolint:errcheck
}
if v, ok := env.Lookup(cmd.Context(), envLogFormat); ok {
_ = f.output.Set(v)
f.output.Set(v) //nolint:errcheck
}

flags := cmd.PersistentFlags()
Expand Down

0 comments on commit 13070ae

Please sign in to comment.