diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2021-03-15 02:52:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-14 19:52:12 +0100 |
commit | 167b0f46ef946fad3ca13976c3b87598f505e2ea (patch) | |
tree | 8b6a4a47a2a0149899b3eb49b296677c2dba4d36 /models/issue_comment.go | |
parent | 164e35ead3c1b9b82d4a23644f6fe96652a747eb (diff) | |
download | gitea-167b0f46ef946fad3ca13976c3b87598f505e2ea.tar.gz gitea-167b0f46ef946fad3ca13976c3b87598f505e2ea.zip |
chore(models): rewrite code format. (#14754)
* chore: rewrite format.
* chore: update format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* chore: update format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* chore: Adjacent parameters with the same type should be grouped together
* chore: update format.
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r-- | models/issue_comment.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index 724cf921ea..53d4d638c4 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -267,7 +267,6 @@ func (c *Comment) AfterDelete() { } _, err := DeleteAttachmentsByComment(c.ID, true) - if err != nil { log.Info("Could not delete files for comment %d on issue #%d: %s", c.ID, c.IssueID, err) } @@ -391,7 +390,6 @@ func (c *Comment) LoadLabel() error { // LoadProject if comment.Type is CommentTypeProject, then load project. func (c *Comment) LoadProject() error { - if c.OldProjectID > 0 { var oldProject Project has, err := x.ID(c.OldProjectID).Get(&oldProject) @@ -813,7 +811,7 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin return nil, err } - var opts = &CreateCommentOptions{ + opts := &CreateCommentOptions{ Type: commentType, Doer: doer, Repo: issue.Repo, @@ -828,7 +826,7 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin } // Creates issue dependency comment -func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dependentIssue *Issue, add bool) (err error) { +func createIssueDependencyComment(e *xorm.Session, doer *User, issue, dependentIssue *Issue, add bool) (err error) { cType := CommentTypeAddDependency if !add { cType = CommentTypeRemoveDependency @@ -838,7 +836,7 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep } // Make two comments, one in each issue - var opts = &CreateCommentOptions{ + opts := &CreateCommentOptions{ Type: cType, Doer: doer, Repo: issue.Repo, @@ -977,7 +975,7 @@ type FindCommentsOptions struct { } func (opts *FindCommentsOptions) toConds() builder.Cond { - var cond = builder.NewCond() + cond := builder.NewCond() if opts.RepoID > 0 { cond = cond.And(builder.Eq{"issue.repo_id": opts.RepoID}) } @@ -1149,7 +1147,7 @@ func findCodeComments(e Engine, opts FindCommentsOptions, issue *Issue, currentU // Find all reviews by ReviewID reviews := make(map[int64]*Review) - var ids = make([]int64, 0, len(comments)) + ids := make([]int64, 0, len(comments)) for _, comment := range comments { if comment.ReviewID != 0 { ids = append(ids, comment.ReviewID) |