diff options
| author | Eric Paris <[email protected]> | 2015-08-05 12:46:33 -0400 |
|---|---|---|
| committer | Eric Paris <[email protected]> | 2015-08-05 12:54:03 -0400 |
| commit | 90b831e61ee0ea159e0d00bb0c1ee3cd0c1dcdcd (patch) | |
| tree | 6655dd93a25fe82dfe6362ba8c87f874158834f4 /string_slice.go | |
| parent | af83f852cb3533df209ffef0b0f36b65d4594848 (diff) | |
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"}
```
Diffstat (limited to 'string_slice.go')
| -rw-r--r-- | string_slice.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |
