summaryrefslogtreecommitdiffstats
path: root/models/issue_list.go
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2021-03-15 02:52:12 +0800
committerGitHub <noreply@github.com>2021-03-14 19:52:12 +0100
commit167b0f46ef946fad3ca13976c3b87598f505e2ea (patch)
tree8b6a4a47a2a0149899b3eb49b296677c2dba4d36 /models/issue_list.go
parent164e35ead3c1b9b82d4a23644f6fe96652a747eb (diff)
downloadgitea-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_list.go')
-rw-r--r--models/issue_list.go62
1 files changed, 31 insertions, 31 deletions
diff --git a/models/issue_list.go b/models/issue_list.go
index 5789ad84ae..0ac25fc690 100644
--- a/models/issue_list.go
+++ b/models/issue_list.go
@@ -35,9 +35,9 @@ func (issues IssueList) loadRepositories(e Engine) ([]*Repository, error) {
repoIDs := issues.getRepoIDs()
repoMaps := make(map[int64]*Repository, len(repoIDs))
- var left = len(repoIDs)
+ left := len(repoIDs)
for left > 0 {
- var limit = defaultMaxInSize
+ limit := defaultMaxInSize
if left < limit {
limit = left
}
@@ -79,9 +79,9 @@ func (issues IssueList) loadPosters(e Engine) error {
posterIDs := issues.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
}
@@ -108,7 +108,7 @@ func (issues IssueList) loadPosters(e Engine) error {
}
func (issues IssueList) getIssueIDs() []int64 {
- var ids = make([]int64, 0, len(issues))
+ ids := make([]int64, 0, len(issues))
for _, issue := range issues {
ids = append(ids, issue.ID)
}
@@ -125,11 +125,11 @@ func (issues IssueList) loadLabels(e Engine) error {
IssueLabel *IssueLabel `xorm:"extends"`
}
- var issueLabels = make(map[int64][]*Label, len(issues)*3)
- var issueIDs = issues.getIssueIDs()
- var left = len(issueIDs)
+ issueLabels := make(map[int64][]*Label, len(issues)*3)
+ issueIDs := issues.getIssueIDs()
+ left := len(issueIDs)
for left > 0 {
- var limit = defaultMaxInSize
+ limit := defaultMaxInSize
if left < limit {
limit = left
}
@@ -169,7 +169,7 @@ func (issues IssueList) loadLabels(e Engine) error {
}
func (issues IssueList) getMilestoneIDs() []int64 {
- var ids = make(map[int64]struct{}, len(issues))
+ ids := make(map[int64]struct{}, len(issues))
for _, issue := range issues {
if _, ok := ids[issue.MilestoneID]; !ok {
ids[issue.MilestoneID] = struct{}{}
@@ -185,9 +185,9 @@ func (issues IssueList) 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
}
@@ -217,11 +217,11 @@ func (issues IssueList) loadAssignees(e Engine) error {
Assignee *User `xorm:"extends"`
}
- var assignees = make(map[int64][]*User, len(issues))
- var issueIDs = issues.getIssueIDs()
- var left = len(issueIDs)
+ assignees := make(map[int64][]*User, len(issues))
+ issueIDs := issues.getIssueIDs()
+ left := len(issueIDs)
for left > 0 {
- var limit = defaultMaxInSize
+ limit := defaultMaxInSize
if left < limit {
limit = left
}
@@ -259,7 +259,7 @@ func (issues IssueList) loadAssignees(e Engine) error {
}
func (issues IssueList) getPullIssueIDs() []int64 {
- var ids = make([]int64, 0, len(issues))
+ ids := make([]int64, 0, len(issues))
for _, issue := range issues {
if issue.IsPull && issue.PullRequest == nil {
ids = append(ids, issue.ID)
@@ -275,9 +275,9 @@ func (issues IssueList) loadPullRequests(e Engine) error {
}
pullRequestMaps := make(map[int64]*PullRequest, len(issuesIDs))
- var left = len(issuesIDs)
+ left := len(issuesIDs)
for left > 0 {
- var limit = defaultMaxInSize
+ limit := defaultMaxInSize
if left < limit {
limit = left
}
@@ -317,11 +317,11 @@ func (issues IssueList) loadAttachments(e Engine) (err error) {
return nil
}
- var attachments = make(map[int64][]*Attachment, len(issues))
- var issuesIDs = issues.getIssueIDs()
- var left = len(issuesIDs)
+ attachments := make(map[int64][]*Attachment, len(issues))
+ issuesIDs := issues.getIssueIDs()
+ left := len(issuesIDs)
for left > 0 {
- var limit = defaultMaxInSize
+ limit := defaultMaxInSize
if left < limit {
limit = left
}
@@ -362,11 +362,11 @@ func (issues IssueList) loadComments(e Engine, cond builder.Cond) (err error) {
return nil
}
- var comments = make(map[int64][]*Comment, len(issues))
- var issuesIDs = issues.getIssueIDs()
- var left = len(issuesIDs)
+ comments := make(map[int64][]*Comment, len(issues))
+ issuesIDs := issues.getIssueIDs()
+ left := len(issuesIDs)
for left > 0 {
- var limit = defaultMaxInSize
+ limit := defaultMaxInSize
if left < limit {
limit = left
}
@@ -411,18 +411,18 @@ func (issues IssueList) loadTotalTrackedTimes(e Engine) (err error) {
if len(issues) == 0 {
return nil
}
- var trackedTimes = make(map[int64]int64, len(issues))
+ trackedTimes := make(map[int64]int64, len(issues))
- var ids = make([]int64, 0, len(issues))
+ ids := make([]int64, 0, len(issues))
for _, issue := range issues {
if issue.Repo.IsTimetrackerEnabled() {
ids = append(ids, issue.ID)
}
}
- var left = len(ids)
+ left := len(ids)
for left > 0 {
- var limit = defaultMaxInSize
+ limit := defaultMaxInSize
if left < limit {
limit = left
}