mirror of
https://github.com/golang/go
synced 2024-11-18 13:34:41 -07: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
|
||||
oldGOROOT := build.Default.GOROOT
|
||||
oldCompiler := build.Default.Compiler
|
||||
build.Default.GOPATH = ""
|
||||
build.Default.Compiler = "gc"
|
||||
testHookScanDir = func(string) {}
|
||||
|
||||
defer func() {
|
||||
testHookScanDir = func(string) {}
|
||||
build.Default.GOPATH = oldGOPATH
|
||||
build.Default.GOROOT = oldGOROOT
|
||||
build.Default.Compiler = oldCompiler
|
||||
}()
|
||||
|
||||
fn()
|
||||
|
Loading…
Reference in New Issue
Block a user