Migrating from govendor to go dep
Change-Id: I08f2863450e141f1fed0bdef4b9ba64157c7289d
diff --git a/vendor/github.com/kelseyhightower/envconfig/envconfig.go b/vendor/github.com/kelseyhightower/envconfig/envconfig.go
index 3ad5e7d..892d746 100644
--- a/vendor/github.com/kelseyhightower/envconfig/envconfig.go
+++ b/vendor/github.com/kelseyhightower/envconfig/envconfig.go
@@ -265,6 +265,27 @@
}
}
field.Set(sl)
+ case reflect.Map:
+ pairs := strings.Split(value, ",")
+ mp := reflect.MakeMap(typ)
+ for _, pair := range pairs {
+ kvpair := strings.Split(pair, ":")
+ if len(kvpair) != 2 {
+ return fmt.Errorf("invalid map item: %q", pair)
+ }
+ k := reflect.New(typ.Key()).Elem()
+ err := processField(kvpair[0], k)
+ if err != nil {
+ return err
+ }
+ v := reflect.New(typ.Elem()).Elem()
+ err = processField(kvpair[1], v)
+ if err != nil {
+ return err
+ }
+ mp.SetMapIndex(k, v)
+ }
+ field.Set(mp)
}
return nil