diff options
| author | Robert Griesemer <gri@golang.org> | 2016-11-10 14:40:32 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2016-11-10 23:40:07 +0000 |
| commit | 35ea53dcc8d8350898250e87a0b5ffa03e14173e (patch) | |
| tree | b6f1dd21d6c8684bc917c93e80db1c5298c8872a /src/encoding/json | |
| parent | 0457957c991dde4bbdeefb73bc9fb01827298bd9 (diff) | |
| download | go-35ea53dcc8d8350898250e87a0b5ffa03e14173e.tar.xz | |
cmd/gofmt: don't overwrite read-only files
This reverts the changes from https://golang.org/cl/33018: Instead
of writing the result of gofmt to a tmp file and then rename that
to the original (which doesn't preserve the original file's perm
bits, uid, gid, and possibly other properties because it is hard
to do in a platform-independent way - see #17869), use the original
code that simply overwrites the processed file if gofmt was able to
create a backup first. Upon success, the backup is removed, otherwise
it remains.
Fixes #17873.
For #8984.
Change-Id: Ifcf2bf1f84f730e6060f3517d63b45eb16215ae1
Reviewed-on: https://go-review.googlesource.com/33098
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/encoding/json')
0 files changed, 0 insertions, 0 deletions
