@@ -50,16 +50,7 @@ func NewTestProject(t *testing.T, initPath, wd string, externalProc bool, run Ru
50
50
new .TempDir (ProjectRoot , "vendor" )
51
51
new .CopyTree (initPath )
52
52
53
- // Note that the Travis darwin platform, directories with certain roots such
54
- // as /var are actually links to a dirtree under /private. Without the patch
55
- // below the wd, and therefore the GOPATH, is recorded as "/var/..." but the
56
- // actual process runs in "/private/var/..." and dies due to not being in the
57
- // GOPATH because the roots don't line up.
58
- if externalProc && runtime .GOOS == "darwin" && needsPrivateLeader (new .tempdir ) {
59
- new .Setenv ("GOPATH" , filepath .Join ("/private" , new .tempdir ))
60
- } else {
61
- new .Setenv ("GOPATH" , new .tempdir )
62
- }
53
+ new .Setenv ("GOPATH" , new .tempdir )
63
54
64
55
return new
65
56
}
@@ -283,6 +274,12 @@ func (p *IntegrationTestProject) makeRootTempDir() {
283
274
var err error
284
275
p .tempdir , err = ioutil .TempDir ("" , "gotest" )
285
276
p .Must (err )
277
+
278
+ // Fix for OSX where the tempdir is a symlink:
279
+ if runtime .GOOS == "darwin" {
280
+ p .tempdir , err = filepath .EvalSymlinks (p .tempdir )
281
+ p .Must (err )
282
+ }
286
283
}
287
284
}
288
285
@@ -298,15 +295,3 @@ func (p *IntegrationTestProject) Must(err error) {
298
295
p .t .Fatalf ("%+v" , err )
299
296
}
300
297
}
301
-
302
- // Checks for filepath beginnings that result in the "/private" leader
303
- // on Mac platforms
304
- func needsPrivateLeader (path string ) bool {
305
- var roots = []string {"/var" , "/tmp" , "/etc" }
306
- for _ , root := range roots {
307
- if strings .HasPrefix (path , root ) {
308
- return true
309
- }
310
- }
311
- return false
312
- }
0 commit comments