diff options
| Commit | 1f15111c6e44ea7e855fadc187a19234640e161c (patch) | |
|---|---|---|
| Author | 2021-07-22 10:24:21 +0300 | |
| Committer | 2021-07-22 10:24:21 +0300 | |
| Files | 978254e246e5cba565463549f2715513a48c5762 /go-src/utils | |
| ctfc-1f15111c6e44ea7e855fadc187a19234640e161c.tar ctfc-1f15111c6e44ea7e855fadc187a19234640e161c.tar.gz ctfc-1f15111c6e44ea7e855fadc187a19234640e161c.zip | ||
| Parent | 4f9a8920b080e6aee7e19e394654bf879c5759e2 (diff) | |
Improved structure and added comments
1 files changed, 0 insertions, 14 deletions
| -rw-r--r-- | go-src/utils/utils.go | 14 |
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)] -} |
