From 752ef81056691603c8b305a5f894215d3eb64b14 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 27 Apr 2023 15:56:34 -0700 Subject: [PATCH] net: re check conf.goos even if it equals runtime.GOOS This field is only for testing purposes, where we can't assume that the conf value was initialized as expected for that GOOS. This fixes the net tests on android. Change-Id: I8432587f219a05adbb4d234a813467f876a764b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/489975 Run-TryBot: Ian Lance Taylor Reviewed-by: Bryan Mills TryBot-Result: Gopher Robot Auto-Submit: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/net/conf.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/conf.go b/src/net/conf.go index 2540ac5261..6386078132 100644 --- a/src/net/conf.go +++ b/src/net/conf.go @@ -230,7 +230,7 @@ func (c *conf) hostLookupOrder(r *Resolver, hostname string) (ret hostLookupOrde // For testing purposes only, recheck the GOOS. // This lets TestConfHostLookupOrder test different // GOOS values. - if c.goos != runtime.GOOS && goosPrefersCgo(c.goos) { + if goosPrefersCgo(c.goos) { return hostLookupCgo, nil } -- 2.48.1