Skip to content

proposal: don't include cgo with net on Unix by default #25670

@iangudger

Description

@iangudger

Currently, cgo is included by default with the net package on Unix systems when not cross-compiling to allow the use of libc DNS functions. If the pure Go resolver is sufficiently improved, it should be possible to not include cgo by default (cgo can still be an option).

The net package documentation lists a few cases where the cgo resolver is needed:

  • LOCALDOMAIN, RES_OPTIONS, HOSTALIASES environment variables
  • OS X
  • ASR_CONFIG environment variable on OpenBSD
  • mDNS
  • /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the Go resolver does not implement
  • .local domains

If we limit the scope to Unix minus darwin and openbsd, what is the minimum feature set that we need to implement in order to feel comfortable not including the cgo resolver by default?

/cc @rsc @mdempsky @mikioh @bradfitz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions