]> Cypherpunks repositories - gostls13.git/commitdiff
net: return fallbackOrder immediately for some GOOS
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Thu, 11 May 2023 07:57:33 +0000 (07:57 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 11 May 2023 23:39:53 +0000 (23:39 +0000)
We don't need to check resolv.conf, nsswitch.conf on these systems.
Seems like this was the behaviour before CL 487196.

Change-Id: I34ef3510891c572772a222fbbe47693aa6c7cf38
GitHub-Last-Rev: 3aace0e6615b79bbf379e05ca3a353e194dc7c0b
GitHub-Pull-Request: golang/go#59946
Reviewed-on: https://go-review.googlesource.com/c/go/+/491995
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/net/conf.go

index 10bc8c366e1a82f397c8d0f2ae4e18c723a6148c..cec996f7f0cd2f58239b9fa220ad2d7025956ab5 100644 (file)
@@ -253,6 +253,12 @@ func (c *conf) lookupOrder(r *Resolver, hostname string) (ret hostLookupOrder, d
                canUseCgo = true
        }
 
+       // On systems that don't use /etc/resolv.conf or /etc/nsswitch.conf, we are done.
+       switch c.goos {
+       case "windows", "plan9", "android", "ios":
+               return fallbackOrder, nil
+       }
+
        // Try to figure out the order to use for searches.
        // If we don't recognize something, use fallbackOrder.
        // That will use cgo unless the Go resolver was explicitly requested.