From 54e9ee37a7a301dbe74d46fd3c87712e6120e9bf Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 20 Jan 2022 18:46:10 +0100 Subject: format with gofumpt (#18184) * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt --- modules/setting/setting.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'modules/setting/setting.go') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 3c8e009daa..5b8683f578 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -644,7 +644,7 @@ func loadFromConf(allowEmpty bool, extraConfig string) { } UnixSocketPermissionRaw := sec.Key("UNIX_SOCKET_PERMISSION").MustString("666") UnixSocketPermissionParsed, err := strconv.ParseUint(UnixSocketPermissionRaw, 8, 32) - if err != nil || UnixSocketPermissionParsed > 0777 { + if err != nil || UnixSocketPermissionParsed > 0o777 { log.Fatal("Failed to parse unixSocketPermission: %s", UnixSocketPermissionRaw) } @@ -800,16 +800,16 @@ func loadFromConf(allowEmpty bool, extraConfig string) { SSH.AuthorizedPrincipalsAllow, SSH.AuthorizedPrincipalsEnabled = parseAuthorizedPrincipalsAllow(sec.Key("SSH_AUTHORIZED_PRINCIPALS_ALLOW").Strings(",")) if !SSH.Disabled && !SSH.StartBuiltinServer { - if err := os.MkdirAll(SSH.RootPath, 0700); err != nil { + if err := os.MkdirAll(SSH.RootPath, 0o700); err != nil { log.Fatal("Failed to create '%s': %v", SSH.RootPath, err) - } else if err = os.MkdirAll(SSH.KeyTestPath, 0644); err != nil { + } else if err = os.MkdirAll(SSH.KeyTestPath, 0o644); err != nil { log.Fatal("Failed to create '%s': %v", SSH.KeyTestPath, err) } if len(trustedUserCaKeys) > 0 && SSH.AuthorizedPrincipalsEnabled { fname := sec.Key("SSH_TRUSTED_USER_CA_KEYS_FILENAME").MustString(filepath.Join(SSH.RootPath, "gitea-trusted-user-ca-keys.pem")) if err := os.WriteFile(fname, - []byte(strings.Join(trustedUserCaKeys, "\n")), 0600); err != nil { + []byte(strings.Join(trustedUserCaKeys, "\n")), 0o600); err != nil { log.Fatal("Failed to create '%s': %v", fname, err) } } @@ -1080,7 +1080,7 @@ func loadInternalToken(sec *ini.Section) string { } switch tempURI.Scheme { case "file": - fp, err := os.OpenFile(tempURI.RequestURI(), os.O_RDWR, 0600) + fp, err := os.OpenFile(tempURI.RequestURI(), os.O_RDWR, 0o600) if err != nil { log.Fatal("Failed to open InternalTokenURI (%s): %v", uri, err) } @@ -1173,7 +1173,6 @@ func MakeManifestData(appName, appURL, absoluteAssetURL string) []byte { }, }, }) - if err != nil { log.Error("unable to marshal manifest JSON. Error: %v", err) return make([]byte, 0) -- cgit v1.2.3