diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-07-22 10:24:21 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-07-22 10:24:21 +0300 |
| commit | 1f15111c6e44ea7e855fadc187a19234640e161c (patch) | |
| tree | 978254e246e5cba565463549f2715513a48c5762 /go-src/utils/utils.go | |
| parent | 4f9a8920b080e6aee7e19e394654bf879c5759e2 (diff) | |
| download | ctfc-1f15111c6e44ea7e855fadc187a19234640e161c.tar ctfc-1f15111c6e44ea7e855fadc187a19234640e161c.tar.gz ctfc-1f15111c6e44ea7e855fadc187a19234640e161c.zip | |
Improved structure and added comments
Diffstat (limited to 'go-src/utils/utils.go')
| -rw-r--r-- | go-src/utils/utils.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/go-src/utils/utils.go b/go-src/utils/utils.go index 8d0c1c7..5676744 100644 --- a/go-src/utils/utils.go +++ b/go-src/utils/utils.go @@ -2,8 +2,6 @@ package utils import ( "os" - - ctfcmath "gitlab.com/Syndamia/ctfc/go-src/ctfcMath" ) // Repeats a rune given amount of times and returns the result as a string @@ -35,15 +33,3 @@ func AppendToFile(path string, value string) { allChatsFile.WriteString(value) allChatsFile.Close() } - -/* Pagination */ - -const PageSize = 15 - -func TotalPages(messageAmount int) int { - return ctfcmath.CeilDivInt(messageAmount, PageSize) -} - -func Paginate(page int, messages ...string) []string { - return messages[ctfcmath.MaxInt(len(messages)-PageSize*page, 0) : len(messages)-PageSize*(page-1)] -} |
