diff --git a/imports/fix_test.go b/imports/fix_test.go index 173f9d625e..9382a19ea2 100644 --- a/imports/fix_test.go +++ b/imports/fix_test.go @@ -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) }