diff --git a/controllers/threads_controller.go b/controllers/threads_controller.go index b919417..232a702 100644 --- a/controllers/threads_controller.go +++ b/controllers/threads_controller.go @@ -12,6 +12,7 @@ import ( ) func GetThreads(c *gin.Context) { + // TODO: fix empty query pageString := c.Query("page") page, err := strconv.Atoi(pageString) if err != nil { @@ -34,6 +35,7 @@ func GetThreads(c *gin.Context) { return } + // TODO: if page > pagescount render 404 data := Repositories.IndexPageData{ Threads: threads, PagesCount: int(math.Ceil(float64(count) / 10)), diff --git a/main.go b/main.go index b5a03a4..a762a50 100644 --- a/main.go +++ b/main.go @@ -46,7 +46,7 @@ func main() { "Iterate": func(count int) []int { var i int var Items []int - for i = 1; i < count; i++ { + for i = 1; i < count+1; i++ { Items = append(Items, i) } return Items