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:
parent
5d5aee1f08
commit
268278c53e
@ -7,9 +7,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
simple "github.com/bitly/go-simplejson"
|
||||||
"go-micro.dev/v4/config/reader"
|
"go-micro.dev/v4/config/reader"
|
||||||
"go-micro.dev/v4/config/source"
|
"go-micro.dev/v4/config/source"
|
||||||
simple "github.com/bitly/go-simplejson"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type jsonValues struct {
|
type jsonValues struct {
|
||||||
@ -157,7 +157,7 @@ func (j *jsonValue) StringSlice(def []string) []string {
|
|||||||
v, err := j.Json.String()
|
v, err := j.Json.String()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
sl := strings.Split(v, ",")
|
sl := strings.Split(v, ",")
|
||||||
if len(sl) > 1 {
|
if len(sl) > 0 {
|
||||||
return sl
|
return sl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user