From 1f15111c6e44ea7e855fadc187a19234640e161c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 22 Jul 2021 10:24:21 +0300 Subject: Improved structure and added comments --- go-src/utils/utils.go | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'go-src/utils/utils.go') 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)] -} -- cgit v1.2.3