From 8e4a313f17a22089b53f38437069718469612997 Mon Sep 17 00:00:00 2001 From: Svend Sorensen Date: Wed, 7 Oct 2015 13:28:46 -0700 Subject: [PATCH] Return an empty slice for empty string lists --- config/string_list.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/string_list.go b/config/string_list.go index a175b821d..da45df736 100644 --- a/config/string_list.go +++ b/config/string_list.go @@ -69,11 +69,11 @@ func (sl StringList) Length() int { func (sl StringList) Slice() []string { parts := strings.Split(string(sl), stringListDelim) + // split on an empty StringList will have a length of 2, since there is + // always at least one deliminator switch len(parts) { - case 0, 1: + case 0, 1, 2: return []string{} - case 2: - return []string{""} } // strip empty elements generated by leading and trailing delimiters