From 90b831e61ee0ea159e0d00bb0c1ee3cd0c1dcdcd Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Wed, 5 Aug 2015 12:46:33 -0400 Subject: String and Int slices called twice should append not overwrite This allows users to do things like ``` cmd --filename=file1 --filename=file2 --filename=file3,file4 ``` And internally we will get ``` []string{"file1", "file2", "file3", "file4"} ``` --- string_slice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string_slice.go') diff --git a/string_slice.go b/string_slice.go index b7096e8..20d94ba 100644 --- a/string_slice.go +++ b/string_slice.go @@ -14,7 +14,7 @@ func newStringSliceValue(val []string, p *[]string) *stringSliceValue { func (s *stringSliceValue) Set(val string) error { v := strings.Split(val, ",") - *s = stringSliceValue(v) + *s = append(*s, v...) return nil } func (s *stringSliceValue) Type() string { -- cgit v1.2.3