Fix up some lint/staticcheck recommendations

This commit is contained in:
John Barton
2023-01-27 13:06:52 +11:00
parent 02a6516148
commit d4cc462af7

View File

@ -250,15 +250,15 @@ func parseLine(line string, envMap map[string]string) (key string, value string,
} }
if len(splitString) != 2 { if len(splitString) != 2 {
err = errors.New("Can't separate key from value") err = errors.New("can't separate key from value")
return return
} }
// Parse the key // Parse the key
key = splitString[0] key = splitString[0]
if strings.HasPrefix(key, "export") {
key = strings.TrimPrefix(key, "export") key = strings.TrimPrefix(key, "export")
}
key = strings.TrimSpace(key) key = strings.TrimSpace(key)
key = exportRegex.ReplaceAllString(splitString[0], "$1") key = exportRegex.ReplaceAllString(splitString[0], "$1")