Vendor Update Go Libs (#13444)

* denisenkom/go-mssqldb untagged -> v0.9.0

* github.com/editorconfig/editorconfig-core-go v2.3.7 -> v2.3.8

* github.com/go-testfixtures/testfixtures v3.4.0 -> v3.4.1

* github.com/mholt/archiver v3.3.2 -> v3.5.0

* github.com/olivere/elastic v7.0.20 -> v7.0.21

* github.com/urfave/cli v1.22.4 -> v1.22.5

* github.com/xanzy/go-gitlab v0.38.1 -> v0.39.0

* github.com/yuin/goldmark-meta untagged -> v1.0.0

* github.com/ethantkoenig/rupture 0a76f03a811a -> c3b3b810dc77

* github.com/jaytaylor/html2text 8fb95d837f7d -> 3577fbdbcff7

* github.com/kballard/go-shellquote cd60e84ee657 -> 95032a82bc51

* github.com/msteinert/pam 02ccfbfaf0cc -> 913b8f8cdf8b

* github.com/unknwon/paginater 7748a72e0141 -> 042474bd0eae

* CI.restart()

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
6543 2020-11-06 19:41:42 +01:00 committed by GitHub
parent eebaa81f43
commit 30ce3731a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
184 changed files with 12387 additions and 2975 deletions

9
vendor/github.com/unknwon/paginater/Makefile generated vendored Normal file
View file

@ -0,0 +1,9 @@
.PHONY: build test vet
build: vet
test:
go test -v -cover -race
vet:
go vet

View file

@ -1,5 +1,9 @@
Paginater [![Build Status](https://drone.io/github.com/Unknwon/paginater/status.png)](https://drone.io/github.com/Unknwon/paginater/latest) [![](http://gocover.io/_badge/github.com/Unknwon/paginater)](http://gocover.io/github.com/Unknwon/paginater)
=========
# Paginater
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/unknwon/paginater/Go?logo=github&style=for-the-badge)](https://github.com/unknwon/paginater/actions?query=workflow%3AGo)
[![codecov](https://img.shields.io/codecov/c/github/unknwon/paginater/master?logo=codecov&style=for-the-badge)](https://codecov.io/gh/unknwon/paginater)
[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge&logo=go)](https://pkg.go.dev/github.com/unknwon/paginater?tab=doc)
[![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/unknwon/paginater)
Package paginater is a helper module for custom pagination calculation.
@ -21,7 +25,7 @@ func main() {
// - Total number of rows
// - Number of rows in one page
// - Current page number
// - Number of page links
// - Number of page links to be displayed
p := paginater.New(45, 10, 3, 3)
// Then use p as a template object named "Page" in "demo.html"

5
vendor/github.com/unknwon/paginater/go.mod generated vendored Normal file
View file

@ -0,0 +1,5 @@
module github.com/unknwon/paginater
go 1.14
require github.com/smartystreets/goconvey v1.6.4

12
vendor/github.com/unknwon/paginater/go.sum generated vendored Normal file
View file

@ -0,0 +1,12 @@
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=

View file

@ -96,6 +96,11 @@ func (p *Paginater) Current() int {
return p.current
}
// PagingNum returns number of page size.
func (p *Paginater) PagingNum() int {
return p.pagingNum
}
// Page presents a page in the paginater.
type Page struct {
num int
@ -137,7 +142,6 @@ func (p *Paginater) Pages() []*Page {
}
numPages := p.numPages
maxIdx := numPages - 1
offsetIdx := 0
hasMoreNext := false
@ -156,7 +160,6 @@ func (p *Paginater) Pages() []*Page {
offsetVal := p.current - previousNum
if offsetVal > 1 {
numPages++
maxIdx++
offsetIdx = 1
}