diff options
author | 6543 <6543@obermui.de> | 2022-01-20 18:46:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 18:46:10 +0100 |
commit | 54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch) | |
tree | 1be12fb072625c1b896b9d72f7912b018aad502b /modules/repository/hooks.go | |
parent | 1d98d205f5825f40110e6628b61a97c91ac7f72d (diff) | |
download | gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip |
format with gofumpt (#18184)
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
Diffstat (limited to 'modules/repository/hooks.go')
-rw-r--r-- | modules/repository/hooks.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/repository/hooks.go b/modules/repository/hooks.go index bd77423afc..debaa0ecc4 100644 --- a/modules/repository/hooks.go +++ b/modules/repository/hooks.go @@ -129,7 +129,7 @@ func createDelegateHooks(repoPath string) (err error) { if err = util.Remove(oldHookPath); err != nil && !os.IsNotExist(err) { return fmt.Errorf("unable to pre-remove old hook file '%s' prior to rewriting: %v ", oldHookPath, err) } - if err = os.WriteFile(oldHookPath, []byte(hookTpls[i]), 0777); err != nil { + if err = os.WriteFile(oldHookPath, []byte(hookTpls[i]), 0o777); err != nil { return fmt.Errorf("write old hook file '%s': %v", oldHookPath, err) } @@ -140,7 +140,7 @@ func createDelegateHooks(repoPath string) (err error) { if err = util.Remove(newHookPath); err != nil && !os.IsNotExist(err) { return fmt.Errorf("unable to pre-remove new hook file '%s' prior to rewriting: %v", newHookPath, err) } - if err = os.WriteFile(newHookPath, []byte(giteaHookTpls[i]), 0777); err != nil { + if err = os.WriteFile(newHookPath, []byte(giteaHookTpls[i]), 0o777); err != nil { return fmt.Errorf("write new hook file '%s': %v", newHookPath, err) } @@ -157,7 +157,7 @@ func checkExecutable(filename string) bool { if err != nil { return false } - return (fileInfo.Mode() & 0100) > 0 + return (fileInfo.Mode() & 0o100) > 0 } func ensureExecutable(filename string) error { @@ -165,10 +165,10 @@ func ensureExecutable(filename string) error { if err != nil { return err } - if (fileInfo.Mode() & 0100) > 0 { + if (fileInfo.Mode() & 0o100) > 0 { return nil } - mode := fileInfo.Mode() | 0100 + mode := fileInfo.Mode() | 0o100 return os.Chmod(filename, mode) } |