From 575feb486fd63a0aba438f0ed9c6a62e379b8408 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 26 Jul 2024 14:27:10 -0700 Subject: [PATCH] util/osuser: turn wasm check into a const expression All wasi* are GOARCH wasm, so check that instead. Updates #12732 Change-Id: Id3cc346295c1641bcf80a6c5eb1ad65488509656 Signed-off-by: Brad Fitzpatrick --- util/osuser/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/osuser/user.go b/util/osuser/user.go index 7b313307b..2c7f2e24b 100644 --- a/util/osuser/user.go +++ b/util/osuser/user.go @@ -54,7 +54,7 @@ func lookup(usernameOrUID string, std lookupStd, wantShell bool) (*user.User, st // Skip getent entirely on Non-Unix platforms that won't ever have it. // (Using HasPrefix for "wasip1", anticipating that WASI support will // move beyond "preview 1" some day.) - if runtime.GOOS == "windows" || runtime.GOOS == "js" || strings.HasPrefix(runtime.GOOS, "wasi") { + if runtime.GOOS == "windows" || runtime.GOOS == "js" || runtime.GOARCH == "wasm" { u, err := std(usernameOrUID) return u, "", err }