1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-05 10:20:53 +02:00

fix config json slice parsing (#2330)

Co-authored-by: longhaoteng <longhaoteng@kingsoft.com>
This commit is contained in:
无相 2021-11-01 16:47:00 +08:00 committed by GitHub
parent 5d5aee1f08
commit 268278c53e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}
}