mirror of
https://github.com/spf13/cobra
synced 2025-05-05 04:47:22 +00:00
ref: clean up lint error (#1759)
This commit is contained in:
parent
d5bea272b1
commit
be83846f84
1 changed files with 1 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue