aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-06-12 21:41:28 +0200
committertechknowlogick <techknowlogick@gitea.io>2019-06-12 15:41:28 -0400
commitf9ec2f89f2265bc1371a6c62359de9816534fa6b (patch)
treef48b138a457e5ac6cf843bbb38400926704370f7 /models/issue.go
parent5832f8d90df2d72cb38698c3e9050f2b29717dc7 (diff)
downloadgitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.tar.gz
gitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.zip
Add golangci (#6418)
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/models/issue.go b/models/issue.go
index 999bd2f7a9..27298b8a86 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -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)