TODO: defer workaround, should remove after fix

This commit is contained in:
Li Jie
2025-04-11 17:14:26 +08:00
parent 5a13e7400e
commit 19b98393a6
4 changed files with 10 additions and 4 deletions

View File

@@ -163,12 +163,13 @@ func Clearenv() {
func Environ() []string {
envOnce.Do(copyenv)
envLock.RLock()
defer envLock.RUnlock()
//TODO(lijie): workaround for defer crash on wasm
a := make([]string, 0, len(envs))
for _, env := range envs {
if env != "" {
a = append(a, env)
}
}
envLock.RUnlock()
return a
}