aboutsummaryrefslogtreecommitdiff
path: root/string_slice.go
diff options
context:
space:
mode:
authorEric Paris <[email protected]>2015-08-05 10:39:39 -0400
committerEric Paris <[email protected]>2015-08-05 10:39:39 -0400
commit3ff81a4d249e850a75cb2c3042156b31961e50a3 (patch)
tree3d5326bdba286d4f3992d348caf6e944947903b8 /string_slice.go
parent67cbc198fd11dab704b214c1e629a97af392c085 (diff)
Show [] around string slices when showing the text
This means things like autogenerated docs will show `--filename=[]` instead of just `--filename=`
Diffstat (limited to 'string_slice.go')
-rw-r--r--string_slice.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/string_slice.go b/string_slice.go
index bbe6e00..b7096e8 100644
--- a/string_slice.go
+++ b/string_slice.go
@@ -21,9 +21,10 @@ func (s *stringSliceValue) Type() string {
return "stringSlice"
}
-func (s *stringSliceValue) String() string { return strings.Join(*s, ",") }
+func (s *stringSliceValue) String() string { return "[" + strings.Join(*s, ",") + "]" }
func stringSliceConv(sval string) (interface{}, error) {
+ sval = strings.Trim(sval, "[]")
v := strings.Split(sval, ",")
return v, nil
}