forked from forgejo/forgejo
Add golangci (#6418)
This commit is contained in:
parent
5832f8d90d
commit
f9ec2f89f2
147 changed files with 1046 additions and 774 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue