Skip to content

Instantly share code, notes, and snippets.

@skull-squadron
Created July 17, 2025 08:48
Show Gist options
  • Save skull-squadron/6865cb210b9135851804518a9d255113 to your computer and use it in GitHub Desktop.
Save skull-squadron/6865cb210b9135851804518a9d255113 to your computer and use it in GitHub Desktop.
Patch to make go 1.4 build and test on amd64 under Rosetta 2
--- a/os/exec/exec_test.go 2025-07-17 08:31:03.824802001 +0000
+++ b/os/exec/exec_test.go 2025-07-17 08:40:30.611330000 +0000
@@ -262,6 +262,7 @@
}
func closeUnexpectedFds(t *testing.T, m string) {
+ t.Skip("Doesn't work on amd64 on Rosetta 2 or on QEMU")
for fd := basefds(); fd <= 101; fd++ {
err := os.NewFile(fd, "").Close()
if err == nil {
--- a/net/file_test.go 2025-07-17 08:42:19.295752009 +0000
+++ b/net/file_test.go 2025-07-17 08:43:46.344466007 +0000
@@ -117,6 +117,7 @@
t.Fatalf("LocalAddrs not equal: %#v != %#v", pcf.LocalAddr(), c.LocalAddr())
}
if listen {
+ t.Skip("Doesn't work on amd64 on Rosetta 2 or on QEMU")
if _, err := c.WriteTo([]byte{}, c.LocalAddr()); err != nil {
t.Fatalf("WriteTo failed: %v", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment