1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:48:32 -06:00

go.tools/imports: Permit fix_test.go to work pre-Go 1.4.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/156980043
This commit is contained in:
David Symonds 2014-10-13 08:44:37 +11:00
parent 70f0e2472d
commit 0513cb08b6

View File

@ -727,7 +727,13 @@ func TestFindImportGoPath(t *testing.T) {
stdlib = nil
// Test against imaginary bits/bytes package in std lib
bytesDir := filepath.Join(goroot, "src", "bits", "bytes")
bytesDir := filepath.Join(goroot, "src", "pkg", "bits", "bytes")
for _, tag := range build.Default.ReleaseTags {
// Go 1.4 rearranged the GOROOT tree to remove the "pkg" path component.
if tag == "go1.4" {
bytesDir = filepath.Join(goroot, "src", "bits", "bytes")
}
}
if err := os.MkdirAll(bytesDir, 0755); err != nil {
t.Fatal(err)
}