From d4cc462af709ac39f05af4930620645b745e0e24 Mon Sep 17 00:00:00 2001 From: John Barton Date: Fri, 27 Jan 2023 13:06:52 +1100 Subject: [PATCH] Fix up some lint/staticcheck recommendations --- godotenv.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/godotenv.go b/godotenv.go index 95124e3..368e804 100644 --- a/godotenv.go +++ b/godotenv.go @@ -250,15 +250,15 @@ func parseLine(line string, envMap map[string]string) (key string, value string, } if len(splitString) != 2 { - err = errors.New("Can't separate key from value") + err = errors.New("can't separate key from value") return } // Parse the key key = splitString[0] - if strings.HasPrefix(key, "export") { - key = strings.TrimPrefix(key, "export") - } + + key = strings.TrimPrefix(key, "export") + key = strings.TrimSpace(key) key = exportRegex.ReplaceAllString(splitString[0], "$1")