diff options
| author | Alex Flint <[email protected]> | 2021-04-19 12:49:49 -0700 |
|---|---|---|
| committer | Alex Flint <[email protected]> | 2021-04-19 12:49:49 -0700 |
| commit | 23b96d7aacf62828675decc309eae5b9dce5bd51 (patch) | |
| tree | 548c3c3945b4f725aeab4804f940b0cb9659102a /parse.go | |
| parent | 1dfefdc43e8a9a06b532b5c29f876eb38f86a928 (diff) | |
refactor canParse into kindOf
Diffstat (limited to 'parse.go')
| -rw-r--r-- | parse.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -377,7 +377,7 @@ func cmdFromStruct(name string, dest path, t reflect.Type) (*command, error) { cmd.specs = append(cmd.specs, &spec) var parseable bool - parseable, spec.boolean, spec.multiple = canParse(field.Type) + //parseable, spec.boolean, spec.multiple = canParse(field.Type) if !parseable { errs = append(errs, fmt.Sprintf("%s.%s: %s fields are not supported", t.Name(), field.Name, field.Type.String())) @@ -728,7 +728,7 @@ func findSubcommand(cmds []*command, name string) *command { // isZero returns true if v contains the zero value for its type func isZero(v reflect.Value) bool { t := v.Type() - if t.Kind() == reflect.Slice { + if t.Kind() == reflect.Slice || t.Kind() == reflect.Map { return v.IsNil() } if !t.Comparable() { |
