From 3b03d305991f825d30ba01bd7a6c3a2f2e557b18 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 8 Oct 2021 19:07:36 +0200 Subject: [PATCH] nettest: simplify iOS detection in TestableNetwork Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and darwin/arm64 was repurposed for the macOS ARM64 port (see https://golang.org/doc/go1.16#darwin). Now that Go 1.16 is the oldest supported release, the ios tag can be used exclusively in TestableNetwork to detect iOS, increasing test coverage for darwin/arm64. For golang/go#45696 Change-Id: If607ff8847ed42160ef5e8260d2a8c21798a164a Reviewed-on: https://go-review.googlesource.com/c/net/+/354809 Trust: Tobias Klauser Run-TryBot: Tobias Klauser Reviewed-by: Cherry Mui --- nettest/nettest.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/nettest/nettest.go b/nettest/nettest.go index 83ba858e..ae5413b2 100644 --- a/nettest/nettest.go +++ b/nettest/nettest.go @@ -95,13 +95,8 @@ func TestableNetwork(network string) bool { // This is an internal network name for testing on the // package net of the standard library. switch runtime.GOOS { - case "android", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": + case "android", "fuchsia", "hurd", "ios", "js", "nacl", "plan9", "windows": return false - case "darwin", "ios": - // iOS doesn't support it. - if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { - return false - } } case "ip", "ip4", "ip6": switch runtime.GOOS { @@ -114,15 +109,10 @@ func TestableNetwork(network string) bool { } case "unix", "unixgram": switch runtime.GOOS { - case "android", "fuchsia", "hurd", "js", "nacl", "plan9", "windows": + case "android", "fuchsia", "hurd", "ios", "js", "nacl", "plan9", "windows": return false case "aix": return unixStrmDgramEnabled() - case "darwin", "ios": - // iOS does not support unix, unixgram. - if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { - return false - } } case "unixpacket": switch runtime.GOOS {