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 <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
diff --git a/nettest/nettest.go b/nettest/nettest.go
index 83ba858..ae5413b 100644
--- a/nettest/nettest.go
+++ b/nettest/nettest.go
@@ -95,13 +95,8 @@
// 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 @@
}
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 {