With a quick look, it seems "net" is not the only pkg which depends on cgo, though by default it uses pure Go DNS resolver only.
I tested on small program: package main import ( "fmt" "net/http" ) func main() { fmt.Println("Hello, playground") http.ListenAndServe(":9999", nil) } Which is dynamically linked if CGO_ENABLED=1 is set, and statically linked if CGO_ENABLED=0 is set, irrespective of GODEBUG=netdns=go . Diffing the cgo symbols from ELFs from the 2 cases shows that enabling cgo adds 61 more functions: _cgo_b0c710f30cfd_C2func_ _cgo_b0c710f30cfd_C2func_ _cgo_b0c710f30cfd_Cfunc__ _cgo_b0c710f30cfd_Cfunc_f _cgo_b0c710f30cfd_Cfunc_f _cgo_b0c710f30cfd_Cfunc_g _cgo_b0c710f30cfd_Cfunc_g _cgo_b0c710f30cfd_Cfunc_g cgo_context_function _cgo_get_context_function _cgo_panic _cgo_panic _cgo_release_context _cgo_sys_thread_start _cgo_topofstack _cgo_topofstack _cgo_try_pthread_create _cgo_wait_runtime_init_do net._cgo_b0c710f30cfd_C2f net._cgo_b0c710f30cfd_Cfu net._cgo_b0c710f30cfd_Cfu net._cgo_b0c710f30cfd_Cfu net._cgo_b0c710f30cfd_Cfu net._cgo_cmalloc net.cgoIPLookup net.cgoLookupIP net.cgoLookupIPCNAME net.cgoLookupIPCNAME.func net.cgoLookupIPCNAME.func net.cgoLookupIPCNAME.func net.cgoLookupPort net.cgoLookupServicePort net.cgoLookupServicePort. net.cgoLookupServicePort. net.cgoLookupServicePort. net.cgoPortLookup runtime.cgoAlwaysFalse runtime/cgo(.bss) runtime.cgocallback runtime.cgoCheckArg runtime.cgoCheckPointer runtime.cgoCheckUnknownPo runtime._cgo_panic_intern runtime/cgo(.rodata) runtime/cgo(.rodata.str1. runtime/cgo(.rodata.str1. runtime/cgo(.text) runtime.cgoUse x_cgo_callers x_cgo_init x_cgo_inittls x_cgo_mmap x_cgo_munmap x_cgo_notify_runtime_init x_cgo_set_context_functio x_cgo_setenv x_cgo_sigaction x_cgo_sys_thread_create x_cgo_threadentry x_cgo_thread_start x_cgo_unsetenv Here we can see "net" is not the only pkg that uses CGO, but runtime uses it as well. These can be explored to understand more. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.