From: Ian Lance Taylor Date: Thu, 27 Apr 2023 22:56:34 +0000 (-0700) Subject: net: re check conf.goos even if it equals runtime.GOOS X-Git-Tag: go1.21rc1~754 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=752ef81056691603c8b305a5f894215d3eb64b14;p=gostls13.git 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 --- 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 }