Ensure slice types can safely round-trip through flag.FlagSet

This commit is contained in:
Dan Buch
2016-04-29 02:30:49 -04:00
parent ee736e063a
commit d1b0c49a98
2 changed files with 32 additions and 1 deletions

View File

@@ -362,7 +362,8 @@ func lookupBoolT(name string, set *flag.FlagSet) bool {
func copyFlag(name string, ff *flag.Flag, set *flag.FlagSet) {
switch ff.Value.(type) {
case *StringSlice:
case Serializeder:
set.Set(name, ff.Value.(Serializeder).Serialized())
default:
set.Set(name, ff.Value.String())
}