]> Cypherpunks repositories - gostls13.git/commitdiff
misc/dist: remove lingering ~ file
authorAlex Brainman <alex.brainman@gmail.com>
Thu, 30 May 2013 02:11:17 +0000 (12:11 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 30 May 2013 02:11:17 +0000 (12:11 +1000)
Fixes #5405.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/9856043

misc/dist/bindist.go

index 19b0baac20538264b10f820bf17bb1b35579bb91..596a070b80d4330bb6b314f6b8d17cf63e527d43 100644 (file)
@@ -216,6 +216,12 @@ func (b *Build) Do() error {
                        // Re-install std without -race, so that we're not left
                        // with a slower, race-enabled cmd/go, cmd/godoc, etc.
                        _, err = b.run(src, goCmd, "install", "-a", "std")
+                       // Re-building go command leaves old versions of go.exe as go.exe~ on windows.
+                       // See (*builder).copyFile in $GOROOT/src/cmd/go/build.go for details.
+                       // Remove it manually.
+                       if b.OS == "windows" {
+                               os.Remove(goCmd + "~")
+                       }
                }
                if err != nil {
                        return err