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
Родитель 70f0e2472d
Коммит 0513cb08b6
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -727,7 +727,13 @@ func TestFindImportGoPath(t *testing.T) {
stdlib = nil stdlib = nil
// Test against imaginary bits/bytes package in std lib // 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 { if err := os.MkdirAll(bytesDir, 0755); err != nil {
t.Fatal(err) t.Fatal(err)
} }