From 2a53cb31c3d8f99e2d7ae8e9751ac93c548beecf Mon Sep 17 00:00:00 2001 From: Andrea Barisani Date: Mon, 9 Sep 2024 18:40:21 +0200 Subject: [PATCH] improve GOOS=tamago test coverage --- src/net/dial_test.go | 2 +- src/net/http/transport_test.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/net/dial_test.go b/src/net/dial_test.go index 6bd27ca428a04..d02bce4ad4216 100644 --- a/src/net/dial_test.go +++ b/src/net/dial_test.go @@ -955,7 +955,7 @@ func TestDialListenerAddr(t *testing.T) { // To address both of those problems, we open a tcp4-only localhost port, but // then dial the address string that the listener would have reported for a // dual-stack port. - ln, err := Listen("tcp4", ":0") + ln, err := Listen("tcp4", "127.0.0.1:0") if err != nil { t.Fatal(err) } diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index ae7159dab00d3..db33c9b945332 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -3394,6 +3394,9 @@ func testProxyForRequest(t *testing.T, tt proxyFromEnvTest, proxyForRequest func t.Errorf("%v: got error = %q, want %q", tt, g, e) return } + if url == nil && tt.want == "" { + return + } if got := fmt.Sprintf("%s", url); got != tt.want { t.Errorf("%v: got URL = %q, want %q", tt, url, tt.want) }