添加空字符判断
This commit is contained in:
parent
22478bd818
commit
1075b5bbaf
15
config.go
15
config.go
|
@ -27,16 +27,21 @@ func (curls *YamlCurls) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
|
|
||||||
switch tbuf := buf.(type) {
|
switch tbuf := buf.(type) {
|
||||||
case string:
|
case string:
|
||||||
|
if tbuf != "" {
|
||||||
for _, curlinfo := range parseCurl(tbuf) {
|
for _, curlinfo := range parseCurl(tbuf) {
|
||||||
*curls = append(*curls, curlinfo)
|
*curls = append(*curls, curlinfo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case []interface{}:
|
case []interface{}:
|
||||||
for _, ifa := range tbuf {
|
for _, ifa := range tbuf {
|
||||||
for _, curlinfo := range parseCurl(ifa.(string)) {
|
curlstr := ifa.(string)
|
||||||
*curls = append(*curls, curlinfo)
|
if curlstr != "" {
|
||||||
|
for _, curlinfo := range parseCurl(curlstr) {
|
||||||
|
*curls = append(*curls, curlinfo)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return errors.New("read curls is error, " + reflect.TypeOf(buf).String())
|
return errors.New("read curls is error, " + reflect.TypeOf(buf).String())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user