mirror of
https://github.com/golang/go
synced 2024-11-18 13:34:41 -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:
parent
e83451b9c2
commit
e14d0b6f6b
@ -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" {
|
||||
|
Loading…
Reference in New Issue
Block a user