Skip to content

Commit

Permalink
Make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
aruiz14 committed Oct 23, 2023
1 parent 0172bd4 commit 22da0ce
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions internal/cmd/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,16 @@ func Command(obj Runnable, cmd cobra.Command) *cobra.Command {
panic("Unknown kind on field " + fieldType.Name + " on " + objValue.Type().Name())
}

if env != nil {
for _, env := range env {
envs = append(envs, func() {
v := os.Getenv(env)
if v != "" {
fv, err := flags.GetString(name)
if err == nil && (fv == "" || fv == defValue) {
flags.Set(name, v)
}
for _, env := range env {
envs = append(envs, func() {
v := os.Getenv(env)
if v != "" {
fv, err := flags.GetString(name)
if err == nil && (fv == "" || fv == defValue) {
_ = flags.Set(name, v)
}
})
}
}
})
}
}

Expand Down

0 comments on commit 22da0ce

Please sign in to comment.