style: gofumpt all the things (#9829)

Literally `gofumpt -w .` from the top level dir. Guaranteed to be minor
style changes only and nothing else.

@imsodin per request?
This commit is contained in:
Jakob Borg
2024-11-19 11:32:56 +01:00
committed by GitHub
parent 4b815fc086
commit e82ed6e3d3
88 changed files with 376 additions and 379 deletions
+1 -3
View File
@@ -10,9 +10,7 @@ import (
"github.com/syncthing/syncthing/lib/logger"
)
var (
l = logger.DefaultLogger.NewFacility("app", "Main run facility")
)
var l = logger.DefaultLogger.NewFacility("app", "Main run facility")
func shouldDebug() bool {
return l.ShouldDebug("app")
+2 -2
View File
@@ -33,7 +33,7 @@ func EnsureDir(dir string, mode fs.FileMode) error {
// Apparently the stat may fail even though the mkdirall passed. If it
// does, we'll just assume things are in order and let other things
// fail (like loading or creating the config...).
currentMode := fi.Mode() & 0777
currentMode := fi.Mode() & 0o777
if currentMode != mode {
err := fs.Chmod(".", mode)
// This can fail on crappy filesystems, nothing we can do about it.
@@ -139,7 +139,7 @@ func copyFile(src, dst string) error {
return err
}
if err := os.WriteFile(dst, bs, 0600); err != nil {
if err := os.WriteFile(dst, bs, 0o600); err != nil {
// Attempt to clean up
os.Remove(dst)
return err