From: Mateusz Poliwczak Date: Fri, 27 Sep 2024 19:20:58 +0000 (+0000) Subject: net: improve documentation of netgo/netcgo build tags X-Git-Tag: go1.24rc1~802 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=869932d700cf161c19eec65d66b9fe55482698db;p=gostls13.git net: improve documentation of netgo/netcgo build tags Updates #69680 Change-Id: If80d43da493cb035164ede4a2cadcbec5831feaf GitHub-Last-Rev: b3853e9487da1006ecece9dd378e3de299d0b1da GitHub-Pull-Request: golang/go#69682 Reviewed-on: https://go-review.googlesource.com/c/go/+/616262 Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek Reviewed-by: Ian Lance Taylor --- diff --git a/src/net/net.go b/src/net/net.go index f8b5834acb..82dc222de1 100644 --- a/src/net/net.go +++ b/src/net/net.go @@ -68,6 +68,11 @@ GODEBUG environment variable (see package runtime) to go or cgo, as in: The decision can also be forced while building the Go source tree by setting the netgo or netcgo build tag. +The netgo build tag disables entirely the use of the native (CGO) resolver, +meaning the Go resolver is the only one that can be used. +With the netcgo build tag the native and the pure Go resolver are compiled into the binary, +but the native (CGO) resolver is preferred over the Go resolver. +With netcgo, the Go resolver can still be forced at runtime with GODEBUG=netdns=go. A numeric netdns setting, as in GODEBUG=netdns=1, causes the resolver to print debugging information about its decisions.