fix: handle nil map issue

This commit is contained in:
Jose Diaz-Gonzalez
2023-01-21 17:26:52 -05:00
parent 91975c5bfe
commit 1a498b0b76

View File

@@ -76,7 +76,7 @@ func CommandUsage(helpHeader string, helpContent string) {
// EnvWrap wraps a func with a setenv call and resets the value at the end
func EnvWrap(fn func() error, environ map[string]string) error {
var oldEnviron map[string]string
oldEnviron := map[string]string{}
for key, value := range environ {
oldEnviron[key] = os.Getenv(key)
if err := os.Setenv(key, value); err != nil {