mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Enable addtional linters (#34085)
enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
@@ -72,10 +73,10 @@ func PushCreateRepo(ctx context.Context, authUser, owner *user_model.User, repoN
|
||||
if ok, err := organization.CanCreateOrgRepo(ctx, owner.ID, authUser.ID); err != nil {
|
||||
return nil, err
|
||||
} else if !ok {
|
||||
return nil, fmt.Errorf("cannot push-create repository for org")
|
||||
return nil, errors.New("cannot push-create repository for org")
|
||||
}
|
||||
} else if authUser.ID != owner.ID {
|
||||
return nil, fmt.Errorf("cannot push-create repository for another user")
|
||||
return nil, errors.New("cannot push-create repository for another user")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +95,7 @@ func PushCreateRepo(ctx context.Context, authUser, owner *user_model.User, repoN
|
||||
func Init(ctx context.Context) error {
|
||||
licenseUpdaterQueue = queue.CreateUniqueQueue(graceful.GetManager().ShutdownContext(), "repo_license_updater", repoLicenseUpdater)
|
||||
if licenseUpdaterQueue == nil {
|
||||
return fmt.Errorf("unable to create repo_license_updater queue")
|
||||
return errors.New("unable to create repo_license_updater queue")
|
||||
}
|
||||
go graceful.GetManager().RunWithCancel(licenseUpdaterQueue)
|
||||
|
||||
|
Reference in New Issue
Block a user