]> Cypherpunks repositories - gostls13.git/commitdiff
net: re check conf.goos even if it equals runtime.GOOS
authorIan Lance Taylor <iant@golang.org>
Thu, 27 Apr 2023 22:56:34 +0000 (15:56 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 28 Apr 2023 13:22:04 +0000 (13:22 +0000)
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 <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/net/conf.go

index 2540ac526127562f38a3d136566e5bf2dddb8d18..6386078132a4ed504cecc5aa073c111c6137bae7 100644 (file)
@@ -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
                }