cmd/go: remove work directory on usage error
Ensure that cmd/go consistently calls base.Exit rather than os.Exit, so that we don't incorrectly leave the work directory around on exit. Test this by modifying the testsuite to run all the tests with TMPDIR set to a temporary directory, and then check that no files are left behind in that temporary directory. Adjust a couple of tests to make this approach work. Updates #30500 Updates https://gcc.gnu.org/PR89406 Change-Id: Ib6a5fc8a288a6cf4713022baa2b8dfefad62ba34 Reviewed-on: https://go-review.googlesource.com/c/163237 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Showing
Please register or sign in to comment