fix tests

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
This commit is contained in:
Pedro Tôrres 2024-12-21 20:57:26 -08:00
parent 8223b5c5b8
commit 25d06ffe81
2 changed files with 4 additions and 3 deletions

View File

@ -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)(/[^,]*)?`),

View File

@ -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) {