diff --git a/util.go b/util.go index 82579cf..8f9c704 100644 --- a/util.go +++ b/util.go @@ -30,7 +30,7 @@ func (v *mapValue) String() string { } func (v *mapValue) Get() interface{} { -return v.v.Interface() + return v.v.Interface() } func (v *mapValue) Set(s string) error { @@ -87,10 +87,9 @@ func (v *sliceValue) String() string { return v.def } - func (v *sliceValue) Get() interface{} { return v.v.Interface() - } +} func (v *sliceValue) Set(s string) error { p := strings.Split(s, v.delim) @@ -407,19 +406,3 @@ func getFlagOpts(tf string) (string, string, string) { } return name, desc, def } - - - -func isZeroValue(f *flag.Flag, value string) bool { - // Build a zero value of the flag's Value type, and see if the - // result of calling its String method equals the value passed in. - // This works unless the Value type is itself an interface type. - typ := reflect.TypeOf(f.Value) - var z reflect.Value - if typ.Kind() == reflect.Pointer { - z = reflect.New(typ.Elem()) - } else { - z = reflect.Zero(typ) - } - return value == z.Interface().(flag.Value).String() -} \ No newline at end of file