]> Cypherpunks repositories - gostls13.git/commitdiff
misc/dist: clean files from GOPATH after building tour
authorAndrew Gerrand <adg@golang.org>
Mon, 8 Jul 2013 01:45:33 +0000 (11:45 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 8 Jul 2013 01:45:33 +0000 (11:45 +1000)
Fixes #5503.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/10989043

misc/dist/bindist.go

index 596a070b80d4330bb6b314f6b8d17cf63e527d43..1d3517be3ece7246c6c60fc9aefe50d48d59049f 100644 (file)
@@ -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 {