diff options
author | silverwind <me@silverwind.io> | 2023-10-24 04:54:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 02:54:59 +0000 |
commit | ce83609ff636f4c09d91ac53bee75a350bb571d6 (patch) | |
tree | 3ddbab3c0de4fe4249352eb52dbe35dc966e3f9e /routers | |
parent | def907de7b3cda899846d55f99b0da2640a5274b (diff) | |
download | gitea-ce83609ff636f4c09d91ac53bee75a350bb571d6.tar.gz gitea-ce83609ff636f4c09d91ac53bee75a350bb571d6.zip |
Upgrade to golangci-lint@v1.55.0 (#27756)
https://github.com/golangci/golangci-lint/releases/tag/v1.55.0
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/pull.go | 3 | ||||
-rw-r--r-- | routers/web/repo/cherry_pick.go | 5 | ||||
-rw-r--r-- | routers/web/repo/issue_dependency.go | 5 | ||||
-rw-r--r-- | routers/web/repo/patch.go | 5 |
4 files changed, 7 insertions, 11 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index a7faaf6fc2..d6b9dddd9d 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -625,9 +625,8 @@ func EditPullRequest(ctx *context.APIContext) { } else if models.IsErrPullRequestHasMerged(err) { ctx.Error(http.StatusConflict, "IsErrPullRequestHasMerged", err) return - } else { - ctx.InternalServerError(err) } + ctx.InternalServerError(err) return } notify_service.PullRequestChangeTargetBranch(ctx, ctx.Doer, pr, form.Base) diff --git a/routers/web/repo/cherry_pick.go b/routers/web/repo/cherry_pick.go index 5017d02252..25dd881219 100644 --- a/routers/web/repo/cherry_pick.go +++ b/routers/web/repo/cherry_pick.go @@ -171,10 +171,9 @@ func CherryPickPost(ctx *context.Context) { } else if models.IsErrCommitIDDoesNotMatch(err) { ctx.RenderWithErr(ctx.Tr("repo.editor.file_changed_while_editing", ctx.Repo.RepoLink+"/compare/"+form.LastCommit+"..."+ctx.Repo.CommitID), tplPatchFile, &form) return - } else { - ctx.RenderWithErr(ctx.Tr("repo.editor.fail_to_apply_patch", err), tplPatchFile, &form) - return } + ctx.RenderWithErr(ctx.Tr("repo.editor.fail_to_apply_patch", err), tplPatchFile, &form) + return } } diff --git a/routers/web/repo/issue_dependency.go b/routers/web/repo/issue_dependency.go index 781c166713..022ec3ae3e 100644 --- a/routers/web/repo/issue_dependency.go +++ b/routers/web/repo/issue_dependency.go @@ -80,10 +80,9 @@ func AddDependency(ctx *context.Context) { } else if issues_model.IsErrCircularDependency(err) { ctx.Flash.Error(ctx.Tr("repo.issues.dependency.add_error_cannot_create_circular")) return - } else { - ctx.ServerError("CreateOrUpdateIssueDependency", err) - return } + ctx.ServerError("CreateOrUpdateIssueDependency", err) + return } } diff --git a/routers/web/repo/patch.go b/routers/web/repo/patch.go index 5faf9f4fa9..c04435cf1b 100644 --- a/routers/web/repo/patch.go +++ b/routers/web/repo/patch.go @@ -104,10 +104,9 @@ func NewDiffPatchPost(ctx *context.Context) { } else if models.IsErrCommitIDDoesNotMatch(err) { ctx.RenderWithErr(ctx.Tr("repo.editor.file_changed_while_editing", ctx.Repo.RepoLink+"/compare/"+form.LastCommit+"..."+ctx.Repo.CommitID), tplPatchFile, &form) return - } else { - ctx.RenderWithErr(ctx.Tr("repo.editor.fail_to_apply_patch", err), tplPatchFile, &form) - return } + ctx.RenderWithErr(ctx.Tr("repo.editor.fail_to_apply_patch", err), tplPatchFile, &form) + return } if form.CommitChoice == frmCommitChoiceNewBranch && ctx.Repo.Repository.UnitEnabled(ctx, unit.TypePullRequests) { |