diff options
Diffstat (limited to 'flag.go')
| -rw-r--r-- | flag.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -437,7 +437,17 @@ func (f *Flag) defaultIsZeroValue() bool { case *intSliceValue, *stringSliceValue, *stringArrayValue: return f.DefValue == "[]" default: - return true + switch f.Value.String() { + case "false": + return true + case "<nil>": + return true + case "": + return true + case "0": + return true + } + return false } } |
