net: treat android like linux in tests
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/112810043
diff --git a/src/pkg/net/unix_test.go b/src/pkg/net/unix_test.go
index 05643dd..1cdff39 100644
--- a/src/pkg/net/unix_test.go
+++ b/src/pkg/net/unix_test.go
@@ -256,8 +256,11 @@
t.Fatalf("UnixConn.Write failed: %v", err)
}
- if runtime.GOOS == "linux" && laddr == "" {
- laddr = "@" // autobind feature
+ switch runtime.GOOS {
+ case "android", "linux":
+ if laddr == "" {
+ laddr = "@" // autobind feature
+ }
}
var connAddrs = [3]struct{ got, want Addr }{
{ln.Addr(), ta},
@@ -308,9 +311,13 @@
}
}()
- if runtime.GOOS == "linux" && laddr == "" {
- laddr = "@" // autobind feature
+ switch runtime.GOOS {
+ case "android", "linux":
+ if laddr == "" {
+ laddr = "@" // autobind feature
+ }
}
+
var connAddrs = [4]struct{ got, want Addr }{
{c1.LocalAddr(), ta},
{c1.RemoteAddr(), nil},