Commit 61fac684 authored by Michael Fraenkel's avatar Michael Fraenkel Committed by Ian Lance Taylor

cmd/go: test: clean up all temporary directories

go test may call builder.init() multiple times which will create a new work directory.  The cleanup needs to hoist the current work directory.
Fixes #7904.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/95900044
parent 8cc5a33f
......@@ -447,7 +447,8 @@ func (b *builder) init() {
fmt.Fprintf(os.Stderr, "WORK=%s\n", b.work)
}
if !buildWork {
atexit(func() { os.RemoveAll(b.work) })
workdir := b.work
atexit(func() { os.RemoveAll(workdir) })
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment