mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
imports: fix test to work with gccgo
Change-Id: I382905b7b7bd8189c169048ba05080ee96e1da5b Reviewed-on: https://go-review.googlesource.com/117995 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
c65208ee29
commit
f96157268c
@ -1214,13 +1214,16 @@ func withEmptyGoPath(fn func()) {
|
|||||||
|
|
||||||
oldGOPATH := build.Default.GOPATH
|
oldGOPATH := build.Default.GOPATH
|
||||||
oldGOROOT := build.Default.GOROOT
|
oldGOROOT := build.Default.GOROOT
|
||||||
|
oldCompiler := build.Default.Compiler
|
||||||
build.Default.GOPATH = ""
|
build.Default.GOPATH = ""
|
||||||
|
build.Default.Compiler = "gc"
|
||||||
testHookScanDir = func(string) {}
|
testHookScanDir = func(string) {}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
testHookScanDir = func(string) {}
|
testHookScanDir = func(string) {}
|
||||||
build.Default.GOPATH = oldGOPATH
|
build.Default.GOPATH = oldGOPATH
|
||||||
build.Default.GOROOT = oldGOROOT
|
build.Default.GOROOT = oldGOROOT
|
||||||
|
build.Default.Compiler = oldCompiler
|
||||||
}()
|
}()
|
||||||
|
|
||||||
fn()
|
fn()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user