summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/main.go b/cmd/main.go
index e932b6b..c475eaa 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -387,11 +387,11 @@ func parseEnvFile(envInput io.Reader) (map[string]string, error) {
}
// split line into key and value
- fields := strings.SplitN(line, "=", 2)
- if len(fields) != 2 {
+ before, after, isCut := strings.Cut(line, "=")
+ if !isCut {
return nil, fmt.Errorf("can't parse line %d; line should be in KEY=VALUE format", lineNumber)
}
- key, val := fields[0], fields[1]
+ key, val := before, after
// sometimes keys are prefixed by "export " so file can be sourced in bash; ignore it here
key = strings.TrimPrefix(key, "export ")