From 0fefe417db0e4343968e5772336289e1c82b88a4 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Sun, 25 Feb 2024 10:15:17 +0000 Subject: [PATCH] cmd/gofmt: remove impossible err!=nil conditional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ife63c766cefc14d2f6bdd3c706f913b1b6f99949 GitHub-Last-Rev: 04e23349e68a3ce12b7d33c0fd3ad8c7ffbd8aaa GitHub-Pull-Request: golang/go#65929 Reviewed-on: https://go-review.googlesource.com/c/go/+/566099 Reviewed-by: Ian Lance Taylor Reviewed-by: Robert Griesemer Reviewed-by: Daniel Martí LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor --- src/cmd/gofmt/gofmt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go index f4fb6bff844..341c79ab8e5 100644 --- a/src/cmd/gofmt/gofmt.go +++ b/src/cmd/gofmt/gofmt.go @@ -555,7 +555,7 @@ func backupFile(filename string, data []byte, perm fs.FileMode) (string, error) if err == nil { break } - if err != nil && !os.IsExist(err) { + if !os.IsExist(err) { return "", err } }