mirror of
https://github.com/golang/go
synced 2024-11-19 14:24:47 -07:00
cmd/go: close unintentionally left open file
cmd/go/internal/work.Builder.updateBuildID left a file opened. But opened files cannot be deleted on Windows, so cmd/go just leaves these files in %TMP% directory. Close the file so deletion can succeed. Fixes #22650 Change-Id: Ia3ea62f6ec7208d73972eae2e17fb4a766407914 Reviewed-on: https://go-review.googlesource.com/76810 Reviewed-by: Dave Cheney <dave@cheney.net> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
bdf30565e2
commit
821e3f7d85
@ -448,6 +448,7 @@ func (b *Builder) updateBuildID(a *Action, target string, rewrite bool) error {
|
||||
r, err := os.Open(target)
|
||||
if err == nil {
|
||||
c.Put(a.actionID, r)
|
||||
r.Close()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user