Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
[official-gcc.git] / libgo / go / net / main_conf_test.go
bloba92dff56c2aae15360b3c337e0e1a3442eeb58cf
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.
5 // +build !js,!plan9,!windows
7 package net
9 // forceGoDNS forces the resolver configuration to use the pure Go resolver
10 // and returns a fixup function to restore the old settings.
11 func forceGoDNS() func() {
12 c := systemConf()
13 oldGo := c.netGo
14 oldCgo := c.netCgo
15 fixup := func() {
16 c.netGo = oldGo
17 c.netCgo = oldCgo
19 c.netGo = true
20 c.netCgo = false
21 return fixup
24 // forceCgoDNS forces the resolver configuration to use the cgo resolver
25 // and returns a fixup function to restore the old settings.
26 // (On non-Unix systems forceCgoDNS returns nil.)
27 func forceCgoDNS() func() {
28 c := systemConf()
29 oldGo := c.netGo
30 oldCgo := c.netCgo
31 fixup := func() {
32 c.netGo = oldGo
33 c.netCgo = oldCgo
35 c.netGo = false
36 c.netCgo = true
37 return fixup