1
0
mirror of https://github.com/golang/go synced 2024-11-18 07:04:52 -07:00

refactor/rename: add pid to name of temporary file for diff

Change-Id: Icd543062b4e1fe8c998f95c0daff5364f08ce83c
Reviewed-on: https://go-review.googlesource.com/18211
Reviewed-by: Ralph Corderoy <ralph.corderoy@gmail.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
Alan Donovan 2015-12-30 11:05:30 -05:00
parent b2a7698651
commit d331899c12

View File

@ -488,7 +488,7 @@ func reallyWriteFile(filename string, content []byte) error {
}
func diff(filename string, content []byte) error {
renamed := filename + ".renamed"
renamed := fmt.Sprintf("%s.%d.renamed", filename, os.Getpid())
if err := ioutil.WriteFile(renamed, content, 0644); err != nil {
return err
}