1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Add golangci (#6418)

This commit is contained in:
kolaente
2019-06-12 21:41:28 +02:00
committed by techknowlogick
parent 5832f8d90d
commit f9ec2f89f2
147 changed files with 1046 additions and 774 deletions

View File

@@ -1330,7 +1330,7 @@ func sortIssuesSession(sess *xorm.Session, sortType string) {
}
}
func (opts *IssuesOptions) setupSession(sess *xorm.Session) error {
func (opts *IssuesOptions) setupSession(sess *xorm.Session) {
if opts.Page >= 0 && opts.PageSize > 0 {
var start int
if opts.Page == 0 {
@@ -1389,7 +1389,6 @@ func (opts *IssuesOptions) setupSession(sess *xorm.Session) error {
fmt.Sprintf("issue.id = il%[1]d.issue_id AND il%[1]d.label_id = %[2]d", i, labelID))
}
}
return nil
}
// CountIssuesByRepo map from repoID to number of issues matching the options
@@ -1397,9 +1396,7 @@ func CountIssuesByRepo(opts *IssuesOptions) (map[int64]int64, error) {
sess := x.NewSession()
defer sess.Close()
if err := opts.setupSession(sess); err != nil {
return nil, err
}
opts.setupSession(sess)
countsSlice := make([]*struct {
RepoID int64
@@ -1424,9 +1421,7 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
sess := x.NewSession()
defer sess.Close()
if err := opts.setupSession(sess); err != nil {
return nil, err
}
opts.setupSession(sess)
sortIssuesSession(sess, opts.SortType)
issues := make([]*Issue, 0, setting.UI.IssuePagingNum)