mirror of
https://github.com/spf13/cobra
synced 2025-04-27 17:17:20 +00:00
make ci lint happy
This commit is contained in:
parent
934601d616
commit
50291d14ea
1 changed files with 3 additions and 1 deletions
|
@ -1833,7 +1833,9 @@ func (c *Command) ParseFlags(args []string) error {
|
||||||
// if flag has been parsed, we should reset flags' value to default
|
// if flag has been parsed, we should reset flags' value to default
|
||||||
if c.Flags().Parsed() {
|
if c.Flags().Parsed() {
|
||||||
c.Flags().Visit(func(f *flag.Flag) {
|
c.Flags().Visit(func(f *flag.Flag) {
|
||||||
f.Value.Set(f.DefValue)
|
if err := f.Value.Set(f.DefValue); err != nil {
|
||||||
|
c.PrintErrf("reset argument[%s] value error %v", f.Name, err)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
err := c.Flags().Parse(args)
|
err := c.Flags().Parse(args)
|
||||||
|
|
Loading…
Add table
Reference in a new issue