From 13e924deb5961431f4836dcb0e247254b9cc23d4 Mon Sep 17 00:00:00 2001 From: shenwei356 Date: Fri, 7 Oct 2016 00:41:20 +0800 Subject: fix bug of string_slice with square brackets --- 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 51e3c5d..7829cfa 100644 --- a/string_slice.go +++ b/string_slice.go @@ -66,7 +66,7 @@ func (s *stringSliceValue) String() string { } func stringSliceConv(sval string) (interface{}, error) { - sval = strings.Trim(sval, "[]") + sval = sval[1 : len(sval)-1] // An empty string would cause a slice with one (empty) string if len(sval) == 0 { return []string{}, nil -- cgit v1.2.3