diff options
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) |