From 77d4347bf26b61bf95a842ff25c579d86b78d4c3 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Thu, 30 May 2013 12:11:17 +1000 Subject: [PATCH] misc/dist: remove lingering ~ file Fixes #5405. R=golang-dev, adg CC=golang-dev https://golang.org/cl/9856043 --- misc/dist/bindist.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc/dist/bindist.go b/misc/dist/bindist.go index 19b0baac20..596a070b80 100644 --- a/misc/dist/bindist.go +++ b/misc/dist/bindist.go @@ -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 -- 2.48.1