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_list.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_list.go')
-rw-r--r-- | models/issue_comment_list.go | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/models/issue_comment_list.go b/models/issue_comment_list.go index f8739e32a6..df1b1ac55f 100644 --- a/models/issue_comment_list.go +++ b/models/issue_comment_list.go @@ -24,9 +24,9 @@ func (comments CommentList) loadPosters(e Engine) error { posterIDs := comments.getPosterIDs() posterMaps := make(map[int64]*User, len(posterIDs)) - var left = len(posterIDs) + left := len(posterIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -53,7 +53,7 @@ func (comments CommentList) loadPosters(e Engine) error { } func (comments CommentList) getCommentIDs() []int64 { - var ids = make([]int64, 0, len(comments)) + ids := make([]int64, 0, len(comments)) for _, comment := range comments { ids = append(ids, comment.ID) } @@ -61,7 +61,7 @@ func (comments CommentList) getCommentIDs() []int64 { } func (comments CommentList) getLabelIDs() []int64 { - var ids = make(map[int64]struct{}, len(comments)) + ids := make(map[int64]struct{}, len(comments)) for _, comment := range comments { if _, ok := ids[comment.LabelID]; !ok { ids[comment.LabelID] = struct{}{} @@ -75,11 +75,11 @@ func (comments CommentList) loadLabels(e Engine) error { return nil } - var labelIDs = comments.getLabelIDs() - var commentLabels = make(map[int64]*Label, len(labelIDs)) - var left = len(labelIDs) + labelIDs := comments.getLabelIDs() + commentLabels := make(map[int64]*Label, len(labelIDs)) + left := len(labelIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -111,7 +111,7 @@ func (comments CommentList) loadLabels(e Engine) error { } func (comments CommentList) getMilestoneIDs() []int64 { - var ids = make(map[int64]struct{}, len(comments)) + ids := make(map[int64]struct{}, len(comments)) for _, comment := range comments { if _, ok := ids[comment.MilestoneID]; !ok { ids[comment.MilestoneID] = struct{}{} @@ -131,9 +131,9 @@ func (comments CommentList) loadMilestones(e Engine) error { } milestoneMaps := make(map[int64]*Milestone, len(milestoneIDs)) - var left = len(milestoneIDs) + left := len(milestoneIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -154,7 +154,7 @@ func (comments CommentList) loadMilestones(e Engine) error { } func (comments CommentList) getOldMilestoneIDs() []int64 { - var ids = make(map[int64]struct{}, len(comments)) + ids := make(map[int64]struct{}, len(comments)) for _, comment := range comments { if _, ok := ids[comment.OldMilestoneID]; !ok { ids[comment.OldMilestoneID] = struct{}{} @@ -174,9 +174,9 @@ func (comments CommentList) loadOldMilestones(e Engine) error { } milestoneMaps := make(map[int64]*Milestone, len(milestoneIDs)) - var left = len(milestoneIDs) + left := len(milestoneIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -197,7 +197,7 @@ func (comments CommentList) loadOldMilestones(e Engine) error { } func (comments CommentList) getAssigneeIDs() []int64 { - var ids = make(map[int64]struct{}, len(comments)) + ids := make(map[int64]struct{}, len(comments)) for _, comment := range comments { if _, ok := ids[comment.AssigneeID]; !ok { ids[comment.AssigneeID] = struct{}{} @@ -211,11 +211,11 @@ func (comments CommentList) loadAssignees(e Engine) error { return nil } - var assigneeIDs = comments.getAssigneeIDs() - var assignees = make(map[int64]*User, len(assigneeIDs)) - var left = len(assigneeIDs) + assigneeIDs := comments.getAssigneeIDs() + assignees := make(map[int64]*User, len(assigneeIDs)) + left := len(assigneeIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -250,7 +250,7 @@ func (comments CommentList) loadAssignees(e Engine) error { // getIssueIDs returns all the issue ids on this comment list which issue hasn't been loaded func (comments CommentList) getIssueIDs() []int64 { - var ids = make(map[int64]struct{}, len(comments)) + ids := make(map[int64]struct{}, len(comments)) for _, comment := range comments { if comment.Issue != nil { continue @@ -264,7 +264,7 @@ func (comments CommentList) getIssueIDs() []int64 { // Issues returns all the issues of comments func (comments CommentList) Issues() IssueList { - var issues = make(map[int64]*Issue, len(comments)) + issues := make(map[int64]*Issue, len(comments)) for _, comment := range comments { if comment.Issue != nil { if _, ok := issues[comment.Issue.ID]; !ok { @@ -273,7 +273,7 @@ func (comments CommentList) Issues() IssueList { } } - var issueList = make([]*Issue, 0, len(issues)) + issueList := make([]*Issue, 0, len(issues)) for _, issue := range issues { issueList = append(issueList, issue) } @@ -285,11 +285,11 @@ func (comments CommentList) loadIssues(e Engine) error { return nil } - var issueIDs = comments.getIssueIDs() - var issues = make(map[int64]*Issue, len(issueIDs)) - var left = len(issueIDs) + issueIDs := comments.getIssueIDs() + issues := make(map[int64]*Issue, len(issueIDs)) + left := len(issueIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -325,7 +325,7 @@ func (comments CommentList) loadIssues(e Engine) error { } func (comments CommentList) getDependentIssueIDs() []int64 { - var ids = make(map[int64]struct{}, len(comments)) + ids := make(map[int64]struct{}, len(comments)) for _, comment := range comments { if comment.DependentIssue != nil { continue @@ -342,11 +342,11 @@ func (comments CommentList) loadDependentIssues(e Engine) error { return nil } - var issueIDs = comments.getDependentIssueIDs() - var issues = make(map[int64]*Issue, len(issueIDs)) - var left = len(issueIDs) + issueIDs := comments.getDependentIssueIDs() + issues := make(map[int64]*Issue, len(issueIDs)) + left := len(issueIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -391,11 +391,11 @@ func (comments CommentList) loadAttachments(e Engine) (err error) { return nil } - var attachments = make(map[int64][]*Attachment, len(comments)) - var commentsIDs = comments.getCommentIDs() - var left = len(commentsIDs) + attachments := make(map[int64][]*Attachment, len(comments)) + commentsIDs := comments.getCommentIDs() + left := len(commentsIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } @@ -429,7 +429,7 @@ func (comments CommentList) loadAttachments(e Engine) (err error) { } func (comments CommentList) getReviewIDs() []int64 { - var ids = make(map[int64]struct{}, len(comments)) + ids := make(map[int64]struct{}, len(comments)) for _, comment := range comments { if _, ok := ids[comment.ReviewID]; !ok { ids[comment.ReviewID] = struct{}{} @@ -443,11 +443,11 @@ func (comments CommentList) loadReviews(e Engine) error { return nil } - var reviewIDs = comments.getReviewIDs() - var reviews = make(map[int64]*Review, len(reviewIDs)) - var left = len(reviewIDs) + reviewIDs := comments.getReviewIDs() + reviews := make(map[int64]*Review, len(reviewIDs)) + left := len(reviewIDs) for left > 0 { - var limit = defaultMaxInSize + limit := defaultMaxInSize if left < limit { limit = left } |