1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 // forceGoDNS forces the resolver configuration to use the pure Go resolver
12 // and returns a fixup function to restore the old settings.
13 func forceGoDNS() func() {
26 // forceCgoDNS forces the resolver configuration to use the cgo resolver
27 // and returns a fixup function to restore the old settings.
28 // (On non-Unix systems forceCgoDNS returns nil.)
29 func forceCgoDNS() func() {
42 func TestForceCgoDNS(t *testing.T) {
44 t.Skip("cgo resolver not available")
47 order, _ := systemConf().hostLookupOrder(nil, "go.dev")
48 if order != hostLookupCgo {
49 t.Fatalf("hostLookupOrder returned: %v, want cgo", order)
53 func TestForceGoDNS(t *testing.T) {
55 order, _ := systemConf().hostLookupOrder(nil, "go.dev")
56 if order == hostLookupCgo {
57 t.Fatalf("hostLookupOrder returned: %v, want go resolver order", order)