diff --git a/envconf.go b/envconf.go index 882e879..3bb6abc 100644 --- a/envconf.go +++ b/envconf.go @@ -48,6 +48,9 @@ func NewConfig() *Config { } if unicode.IsLetter(getFirstRune(key)) { + if len(config.mapEnv[left]) == 0 { + config.mapEnv[left] = make(map[string]cEntry) + } var entry cEntry entry.value = splitted[1] entry.dtype = TypeNone