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 } }