From: Andrew Gerrand Date: Mon, 8 Jul 2013 01:45:33 +0000 (+1000) Subject: misc/dist: clean files from GOPATH after building tour X-Git-Tag: go1.2rc2~1103 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=47a89693e98dfe1e81be10fce769f992483746b3;p=gostls13.git misc/dist: clean files from GOPATH after building tour Fixes #5503. R=golang-dev, r CC=golang-dev https://golang.org/cl/10989043 --- 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 {