From dceee2e983f5dab65c3905ecf40e70e15cf41b7d Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 24 Feb 2025 09:43:41 +0100 Subject: all: use testenv.Executable instead of os.Executable and os.Args[0] In test files, using testenv.Executable is more reliable than os.Executable or os.Args[0]. Change-Id: I88e577efeabc20d02ada27bf706ae4523129128e Reviewed-on: https://go-review.googlesource.com/c/go/+/651955 Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor --- src/runtime/map_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/map_test.go') diff --git a/src/runtime/map_test.go b/src/runtime/map_test.go index c522c44a4e..b1ff02d851 100644 --- a/src/runtime/map_test.go +++ b/src/runtime/map_test.go @@ -1106,7 +1106,7 @@ func computeHash() uintptr { func subprocessHash(t *testing.T, env string) uintptr { t.Helper() - cmd := testenv.CleanCmdEnv(testenv.Command(t, os.Args[0], "-test.run=^TestMemHashGlobalSeed$")) + cmd := testenv.CleanCmdEnv(testenv.Command(t, testenv.Executable(t), "-test.run=^TestMemHashGlobalSeed$")) cmd.Env = append(cmd.Env, "GO_TEST_SUBPROCESS_HASH=1") if env != "" { cmd.Env = append(cmd.Env, env) -- cgit v1.3