1
0
mirror of https://github.com/golang/go synced 2024-11-19 03:44:40 -07:00

cmd/go: leave directory before removing it in TestSharedLibName

Fixes #15124

Change-Id: I55fe4c2957370f3fb417c3df54f99fb085a5dada
Reviewed-on: https://go-review.googlesource.com/21522
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Alex Brainman 2016-04-05 14:10:22 +10:00
parent 31f2bb4ba2
commit bbbd572c10

View File

@ -161,9 +161,12 @@ func TestSharedLibName(t *testing.T) {
}
oldGopath := buildContext.GOPATH
defer func() {
os.RemoveAll(tmpGopath)
buildContext.GOPATH = oldGopath
os.Chdir(cwd)
err := os.RemoveAll(tmpGopath)
if err != nil {
t.Error(err)
}
}()
root := filepath.Join(tmpGopath, "src", data.rootedAt)
err = os.MkdirAll(root, 0755)