1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

fix: split env vars into only two parts

The loadEnv() function was splitting env vars on all `=` characters
which is not correct. Env vars are `key=val` and contain only two parts.
This commit is contained in:
Frank Schroeder 2017-12-05 23:57:43 +01:00 committed by Carlos Alexandro Becker
parent 0074b79819
commit 3e0b7fbd46

View File

@ -39,7 +39,7 @@ func ldflags(ctx *context.Context, build config.Build) (string, error) {
func loadEnvs() map[string]string {
r := map[string]string{}
for _, e := range os.Environ() {
env := strings.Split(e, "=")
env := strings.SplitN(e, "=", 2)
r[env[0]] = env[1]
}
return r