diff options
| author | Sebastiaan Pasterkamp <[email protected]> | 2022-06-05 17:54:46 +0200 |
|---|---|---|
| committer | Sebastiaan Pasterkamp <[email protected]> | 2022-06-05 17:54:46 +0200 |
| commit | b48371a62f7beed42eadc9b719ea4f059aa24ef2 (patch) | |
| tree | 08e7691839bffdf758dcd65027bcebf99dcf90e0 | |
| parent | a87d80089a78b707d9e4fbd7061e54e7e834688d (diff) | |
Simplify sub-command initialization w/o IgnoreDefault
| -rw-r--r-- | parse.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -531,7 +531,7 @@ func (p *Parser) process(args []string) error { // instantiate the field to point to a new struct v := p.val(subcmd.dest) - if !p.config.IgnoreDefault || v.IsNil() { + if v.IsNil() { v.Set(reflect.New(v.Type().Elem())) // we already checked that all subcommands are struct pointers } |
