Skip to content

Commit

Permalink
在windows下运行,会由于环境变量报错推出,尝试修复
Browse files Browse the repository at this point in the history
  • Loading branch information
l3yx committed Jan 5, 2024
1 parent 36d5fba commit 282efc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/util/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func SetEnv(envToSet string) {
if len(keyValue) == 2 { //reg := regexp.MustCompile(`^[A-Za-z0-9_.\s]+$`)
err := os.Unsetenv(keyValue[0])
if err != nil {
panic(err.Error())
log.Println("Error: " + err.Error() + " Code: os.Unsetenv" + keyValue[0])
}
}
}
Expand All @@ -57,7 +57,7 @@ func SetEnv(envToSet string) {
for key, value := range envMap {
err := os.Setenv(key, value)
if err != nil {
panic(err.Error())
log.Println("Error: " + err.Error() + " Code: os.Setenv" + key + ", " + value)
}
}

Expand All @@ -78,7 +78,7 @@ func SetEnv(envToSet string) {

err := os.Setenv(key, value)
if err != nil {
panic(err.Error())
log.Println("Error: " + err.Error() + " Code: os.Setenv" + key + ", " + value)
}
}
}
Expand Down

0 comments on commit 282efc0

Please sign in to comment.