Merge pull request #726 from prometheus/peerpanic

cmd: fix panic on empty peer string
This commit is contained in:
Fabian Reinartz 2017-04-21 14:57:23 +02:00 committed by GitHub
commit 9753a7fcc6

View File

@ -385,7 +385,11 @@ func listen(listen string, router *route.Router) {
type stringset map[string]struct{}
func (ss stringset) Set(value string) error {
ss[value] = struct{}{}
for _, v := range strings.Split(value, ",") {
if v = strings.TrimSpace(v); v != "" {
ss[v] = struct{}{}
}
}
return nil
}