mirror of
https://github.com/go-gitea/gitea
synced 2025-07-11 21:17:19 +00:00
Run gopls modernize
on codebase (#34751)
Recent modernize fixes: https://github.com/golang/tools/commits/master/gopls/internal/analysis/modernize
This commit is contained in:
@ -15,7 +15,7 @@ const windowsSharingViolationError syscall.Errno = 32
|
||||
// Remove removes the named file or (empty) directory with at most 5 attempts.
|
||||
func Remove(name string) error {
|
||||
var err error
|
||||
for i := 0; i < 5; i++ {
|
||||
for range 5 {
|
||||
err = os.Remove(name)
|
||||
if err == nil {
|
||||
break
|
||||
@ -44,7 +44,7 @@ func Remove(name string) error {
|
||||
// RemoveAll removes the named file or (empty) directory with at most 5 attempts.
|
||||
func RemoveAll(name string) error {
|
||||
var err error
|
||||
for i := 0; i < 5; i++ {
|
||||
for range 5 {
|
||||
err = os.RemoveAll(name)
|
||||
if err == nil {
|
||||
break
|
||||
@ -73,7 +73,7 @@ func RemoveAll(name string) error {
|
||||
// Rename renames (moves) oldpath to newpath with at most 5 attempts.
|
||||
func Rename(oldpath, newpath string) error {
|
||||
var err error
|
||||
for i := 0; i < 5; i++ {
|
||||
for i := range 5 {
|
||||
err = os.Rename(oldpath, newpath)
|
||||
if err == nil {
|
||||
break
|
||||
|
Reference in New Issue
Block a user