From 7b77ef35afd01d66f5698b3cd4c87cfee6166ecf Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sat, 15 Jan 2022 18:36:22 +0100 Subject: [PATCH] fix nil map --- envconf.go | 3 +++ 1 file changed, 3 insertions(+) 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