diff --git a/config.go b/config.go index ed7fd41..5feb1f8 100644 --- a/config.go +++ b/config.go @@ -27,16 +27,21 @@ func (curls *YamlCurls) UnmarshalYAML(unmarshal func(interface{}) error) error { switch tbuf := buf.(type) { case string: - - for _, curlinfo := range parseCurl(tbuf) { - *curls = append(*curls, curlinfo) + if tbuf != "" { + for _, curlinfo := range parseCurl(tbuf) { + *curls = append(*curls, curlinfo) + } } case []interface{}: for _, ifa := range tbuf { - for _, curlinfo := range parseCurl(ifa.(string)) { - *curls = append(*curls, curlinfo) + curlstr := ifa.(string) + if curlstr != "" { + for _, curlinfo := range parseCurl(curlstr) { + *curls = append(*curls, curlinfo) + } } + } default: return errors.New("read curls is error, " + reflect.TypeOf(buf).String())