summaryrefslogtreecommitdiffstats
path: root/services/release
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2023-07-07 07:31:56 +0200
committerGitHub <noreply@github.com>2023-07-07 05:31:56 +0000
commit8995046110147ae2c8c98be4e0a8c0b643ccc29c (patch)
tree94a3007199687c0a68eee5889af1619f1eebaf61 /services/release
parentb1eb1676aa95d776ff9085002641ad62e040cd93 (diff)
downloadgitea-8995046110147ae2c8c98be4e0a8c0b643ccc29c.tar.gz
gitea-8995046110147ae2c8c98be4e0a8c0b643ccc29c.zip
Less naked returns (#25713)
just a step towards #25655 and some related refactoring
Diffstat (limited to 'services/release')
-rw-r--r--services/release/release.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/release/release.go b/services/release/release.go
index c1190305b6..1ccbd9c811 100644
--- a/services/release/release.go
+++ b/services/release/release.go
@@ -187,7 +187,7 @@ func CreateNewTag(ctx context.Context, doer *user_model.User, repo *repo_model.R
// editAttachments accept a map of attachment uuid to new attachment name which will be updated with attachments.
func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_model.Release,
addAttachmentUUIDs, delAttachmentUUIDs []string, editAttachments map[string]string,
-) (err error) {
+) error {
if rel.ID == 0 {
return errors.New("UpdateRelease only accepts an exist release")
}
@@ -264,8 +264,8 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod
}
}
- if err = committer.Commit(); err != nil {
- return
+ if err := committer.Commit(); err != nil {
+ return err
}
for _, uuid := range delAttachmentUUIDs {
@@ -280,14 +280,14 @@ func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_mod
if !isCreated {
notification.NotifyUpdateRelease(gitRepo.Ctx, doer, rel)
- return
+ return nil
}
if !rel.IsDraft {
notification.NotifyNewRelease(gitRepo.Ctx, rel)
}
- return err
+ return nil
}
// DeleteReleaseByID deletes a release and corresponding Git tag by given ID.