mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 16:03:20 +02: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:
1 parent
56e42be36d
commit
ee3c82f874
294 files changed
+848
-805
No files matched your search
@@ -5,7 +5,7 @@ package user
|
||||
|
||||
import (
|
||||
std_ctx "context"
|
||||
"fmt"
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
asymkey_model "code.gitea.io/gitea/models/asymkey"
|
||||
@@ -201,7 +201,7 @@ func GetPublicKey(ctx *context.APIContext) {
|
||||
// CreateUserPublicKey creates new public key to given user by ID.
|
||||
func CreateUserPublicKey(ctx *context.APIContext, form api.CreateKeyOption, uid int64) {
|
||||
if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureManageSSHKeys) {
|
||||
ctx.APIErrorNotFound("Not Found", fmt.Errorf("ssh keys setting is not allowed to be visited"))
|
||||
ctx.APIErrorNotFound("Not Found", errors.New("ssh keys setting is not allowed to be visited"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ func DeletePublicKey(ctx *context.APIContext) {
|
||||
// "$ref": "#/responses/notFound"
|
||||
|
||||
if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureManageSSHKeys) {
|
||||
ctx.APIErrorNotFound("Not Found", fmt.Errorf("ssh keys setting is not allowed to be visited"))
|
||||
ctx.APIErrorNotFound("Not Found", errors.New("ssh keys setting is not allowed to be visited"))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user