1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:04:42 -07:00

cmd/godoc: godoc test needs clean up tmp dir when buildGodoc fails.

Change-Id: I584ed27d37a85d39294b07febf396f567d4016a5
Reviewed-on: https://go-review.googlesource.com/2901
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Hyang-Ah Hana Kim 2015-01-15 13:16:57 -05:00 committed by Hyang-Ah Hana Kim
parent e83451b9c2
commit e14d0b6f6b

View File

@ -74,6 +74,11 @@ func buildGodoc(t *testing.T) (bin string, cleanup func()) {
if err != nil {
t.Fatal(err)
}
defer func() {
if cleanup == nil { // probably, go build failed.
os.RemoveAll(tmp)
}
}()
bin = filepath.Join(tmp, "godoc")
if runtime.GOOS == "windows" {