diff options
author | 6543 <6543@obermui.de> | 2023-07-07 07:31:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-07 07:31:56 +0200 |
commit | 8995046110147ae2c8c98be4e0a8c0b643ccc29c (patch) | |
tree | 94a3007199687c0a68eee5889af1619f1eebaf61 /services/issue/issue.go | |
parent | [skip ci] Updated translations via Crowdin (diff) | |
download | forgejo-8995046110147ae2c8c98be4e0a8c0b643ccc29c.tar.xz forgejo-8995046110147ae2c8c98be4e0a8c0b643ccc29c.zip |
Less naked returns (#25713)
just a step towards #25655
and some related refactoring
Diffstat (limited to 'services/issue/issue.go')
-rw-r--r-- | services/issue/issue.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/services/issue/issue.go b/services/issue/issue.go index 61890c75de..b6c6a26cbd 100644 --- a/services/issue/issue.go +++ b/services/issue/issue.go @@ -49,17 +49,17 @@ func NewIssue(ctx context.Context, repo *repo_model.Repository, issue *issues_mo } // ChangeTitle changes the title of this issue, as the given user. -func ChangeTitle(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, title string) (err error) { +func ChangeTitle(ctx context.Context, issue *issues_model.Issue, doer *user_model.User, title string) error { oldTitle := issue.Title issue.Title = title - if err = issues_model.ChangeIssueTitle(ctx, issue, doer, oldTitle); err != nil { - return + if err := issues_model.ChangeIssueTitle(ctx, issue, doer, oldTitle); err != nil { + return err } if issue.IsPull && issues_model.HasWorkInProgressPrefix(oldTitle) && !issues_model.HasWorkInProgressPrefix(title) { - if err = issues_model.PullRequestCodeOwnersReview(ctx, issue, issue.PullRequest); err != nil { - return + if err := issues_model.PullRequestCodeOwnersReview(ctx, issue, issue.PullRequest); err != nil { + return err } } |