From 268278c53ecd565518cceb43fb8527b026c7ab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E7=9B=B8?= Date: Mon, 1 Nov 2021 16:47:00 +0800 Subject: [PATCH] fix config json slice parsing (#2330) Co-authored-by: longhaoteng --- config/reader/json/values.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/reader/json/values.go b/config/reader/json/values.go index 70407085..8adb24a1 100644 --- a/config/reader/json/values.go +++ b/config/reader/json/values.go @@ -7,9 +7,9 @@ import ( "strings" "time" + simple "github.com/bitly/go-simplejson" "go-micro.dev/v4/config/reader" "go-micro.dev/v4/config/source" - simple "github.com/bitly/go-simplejson" ) type jsonValues struct { @@ -157,7 +157,7 @@ func (j *jsonValue) StringSlice(def []string) []string { v, err := j.Json.String() if err == nil { sl := strings.Split(v, ",") - if len(sl) > 1 { + if len(sl) > 0 { return sl } }