aboutsummaryrefslogtreecommitdiff
path: root/string_array.go
diff options
context:
space:
mode:
authorMartin Milata <[email protected]>2016-10-11 13:53:10 +0200
committerMartin Milata <[email protected]>2016-10-11 13:53:10 +0200
commitb027180f68d2dd09ce6a5b64a4e03b9413c8421e (patch)
treeebbbc44937b64104bb115b4944b15013ef208a11 /string_array.go
parentb83537d79690b75cac5e021b036ae16792bf0f20 (diff)
Fix square bracket handling in string_array
Same issue fixed in 13e924de for string_slice.
Diffstat (limited to 'string_array.go')
-rw-r--r--string_array.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/string_array.go b/string_array.go
index f320f2e..93b4e43 100644
--- a/string_array.go
+++ b/string_array.go
@@ -2,7 +2,6 @@ package pflag
import (
"fmt"
- "strings"
)
var _ = fmt.Fprint
@@ -40,7 +39,7 @@ func (s *stringArrayValue) String() string {
}
func stringArrayConv(sval string) (interface{}, error) {
- sval = strings.Trim(sval, "[]")
+ sval = sval[1 : len(sval)-1]
// An empty string would cause a array with one (empty) string
if len(sval) == 0 {
return []string{}, nil