Skip to content

Commit

Permalink
ref: clean up lint error (spf13#1759)
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Aug 1, 2022
1 parent d5bea27 commit be83846
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions flag_groups.go
Expand Up @@ -239,12 +239,6 @@ func processFlagForSpecialGroupAnnotation(flags *flag.FlagSet, pflag *flag.Flag,
}
}
}

// group exists, but we still need to check if the flag exists in the group,
// because the previous loop is short circuited as soon as we find the special.
if _, found := groupStatus[group].data[pflag.Name]; !found {
groupStatus[group].data[pflag.Name] = false
}
groupStatus[group].data[pflag.Name] = pflag.Changed
}
}
Expand Down Expand Up @@ -430,7 +424,7 @@ func (c *Command) enforceFlagGroupsForCompletion() {
for _, flagnameAndStatus := range dependsOnSpecialGroupStatus {
for _, o := range flagnameAndStatus.others {
if flagnameAndStatus.data[o] {
c.MarkFlagRequired(flagnameAndStatus.special)
_ = c.MarkFlagRequired(flagnameAndStatus.special)
break
}
}
Expand Down

0 comments on commit be83846

Please sign in to comment.