From 25d06ffe8159d62a13d407b2b3182f2c77aaad7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20T=C3=B4rres?= Date: Sat, 21 Dec 2024 20:57:26 -0800 Subject: [PATCH] fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pedro Tôrres --- src/cmd/go/internal/work/security.go | 2 +- src/cmd/go/internal/work/security_test.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cmd/go/internal/work/security.go b/src/cmd/go/internal/work/security.go index 5ceb834c38..687602b3bf 100644 --- a/src/cmd/go/internal/work/security.go +++ b/src/cmd/go/internal/work/security.go @@ -236,7 +236,7 @@ var validLinkerFlagsOnDarwin = []*lazyregexp.Regexp{ // conjunction with the `-install_name` and `-rpath` linker flags. // Since the GNU linker does not support Mach-O, targeting Darwin // implies not using the GNU linker. Therefore, we allow @ in the linker - // flags if and only if cfg.GOOS == "darwin". + // flags if and only if cfg.Goos == "darwin". re(`-Wl,-dylib_install_name,@rpath(/[^,]*)?`), re(`-Wl,-install_name,@rpath(/[^,]*)?`), re(`-Wl,-rpath,@(executable_path|loader_path)(/[^,]*)?`), diff --git a/src/cmd/go/internal/work/security_test.go b/src/cmd/go/internal/work/security_test.go index befa645422..2c95672214 100644 --- a/src/cmd/go/internal/work/security_test.go +++ b/src/cmd/go/internal/work/security_test.go @@ -5,10 +5,11 @@ package work import ( - "internal/cfg" "os" "strings" "testing" + + "cmd/go/internal/cfg" ) var goodCompilerFlags = [][]string{ @@ -300,7 +301,7 @@ func TestCheckLinkerFlags(t *testing.T) { } } - goos = cfg.Goos + cfg.Goos = goos } func TestCheckFlagAllowDisallow(t *testing.T) {