mirror of
https://github.com/golang/go
synced 2024-10-06 08:00:07 +00:00
net: don't set netGo = true on Windows with no cgo
Windows can call the C DNS lookup routines even without cgo, so don't force it to use the Go routines in that scenario. No test because the test requires building the tools with CGO_ENABLED=0. For #33097 Fixes #53490 Change-Id: I3595a68e788be0d3bbd1bbd431836aca20a7d757 Reviewed-on: https://go-review.googlesource.com/c/go/+/413458 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
be0b2a393a
commit
92c9b81447
|
@ -8,8 +8,6 @@ package net
|
||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
|
||||||
func init() { netGo = true }
|
|
||||||
|
|
||||||
type addrinfoErrno int
|
type addrinfoErrno int
|
||||||
|
|
||||||
func (eai addrinfoErrno) Error() string { return "<nil>" }
|
func (eai addrinfoErrno) Error() string { return "<nil>" }
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build netgo
|
// Default netGo to true if the netgo build tag is being used, or the
|
||||||
|
// C library DNS routines are not available. Note that the C library
|
||||||
|
// routines are always available on Windows.
|
||||||
|
|
||||||
|
//go:build netgo || (!cgo && !windows)
|
||||||
|
|
||||||
package net
|
package net
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue