fix(config/consul):Config from consul skip empty key (#1830)

* feat(config/consul):skip empty key

* feat(config/consul):delete empty blank
pull/1831/head
Casper-Mars 3 years ago committed by GitHub
parent 6ec695064b
commit c1e98e41de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      contrib/config/consul/config.go

@ -71,6 +71,9 @@ func (s *source) Load() ([]*config.KeyValue, error) {
kvs := make([]*config.KeyValue, 0)
for _, item := range kv {
k := strings.TrimPrefix(item.Key, pathPrefix)
if k == "" {
continue
}
kvs = append(kvs, &config.KeyValue{
Key: k,
Value: item.Value,

Loading…
Cancel
Save