From 012297a862627e236e4d693476a97ffbbf5e27dc Mon Sep 17 00:00:00 2001 From: qmuntal Date: Thu, 30 Mar 2023 10:28:32 +0200 Subject: [PATCH] cmd/gofmt: set backup file permissions on Windows File.Chmod is supported on Windows since CL 250077, there is no need to skip the call anymore. Updates #18026 Change-Id: Ie03cf016e651b93241f73067614fc4cb341504ef Reviewed-on: https://go-review.googlesource.com/c/go/+/480416 Run-TryBot: Quim Muntal TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills Reviewed-by: Matthew Dempsky --- src/cmd/gofmt/gofmt.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go index e464d64c98b..00c8cbdb939 100644 --- a/src/cmd/gofmt/gofmt.go +++ b/src/cmd/gofmt/gofmt.go @@ -470,8 +470,6 @@ func fileWeight(path string, info fs.FileInfo) int64 { return info.Size() } -const chmodSupported = runtime.GOOS != "windows" - // backupFile writes data to a new file named filename with permissions perm, // with