From 47a89693e98dfe1e81be10fce769f992483746b3 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Mon, 8 Jul 2013 11:45:33 +1000 Subject: [PATCH] misc/dist: clean files from GOPATH after building tour Fixes #5503. R=golang-dev, r CC=golang-dev https://golang.org/cl/10989043 --- misc/dist/bindist.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/dist/bindist.go b/misc/dist/bindist.go index 596a070b80..1d3517be3e 100644 --- a/misc/dist/bindist.go +++ b/misc/dist/bindist.go @@ -409,6 +409,13 @@ func (b *Build) Do() error { } func (b *Build) tour() error { + defer func() { + // Clean work files from GOPATH directory. + for _, d := range []string{"bin", "pkg", "src"} { + os.RemoveAll(filepath.Join(b.gopath, d)) + } + }() + // go get the gotour package. _, err := b.run(b.gopath, filepath.Join(b.root, "bin", "go"), "get", *tourPath+"/gotour") if err != nil { -- 2.48.1