fix error parsing env values (#2886)

This commit is contained in:
fatedier 2022-04-05 12:48:57 +08:00 committed by GitHub
parent 915d9f4c09
commit a7a4ba270d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -29,11 +29,11 @@ func init() {
glbEnvs = make(map[string]string)
envs := os.Environ()
for _, env := range envs {
kv := strings.Split(env, "=")
if len(kv) != 2 {
pair := strings.SplitN(env, "=", 2)
if len(pair) != 2 {
continue
}
glbEnvs[kv[0]] = kv[1]
glbEnvs[pair[0]] = pair[1]
}
}