From b60fce2fbbcea0fc7dbdaf52fbcf7424244a6235 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Mon, 24 Aug 2020 21:19:36 +0200 Subject: [PATCH] Rename method --- posts.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posts.go b/posts.go index 8ee4208..6474397 100644 --- a/posts.go +++ b/posts.go @@ -51,7 +51,7 @@ type postPaginationAdapter struct { func (p *postPaginationAdapter) Nums() int { if p.nums == 0 { - p.nums, _ = getPostsNum(p.context, &postsRequestConfig{}) + p.nums, _ = countPosts(p.context, &postsRequestConfig{}) } return p.nums } @@ -151,8 +151,8 @@ func getPosts(context context.Context, config *postsRequestConfig) (posts []*Pos return posts, nil } -func getPostsNum(context context.Context, _ *postsRequestConfig) (num int, err error) { - err = appDb.QueryRowContext(context, "select count(*) from posts").Scan(&num) +func countPosts(context context.Context, _ *postsRequestConfig) (count int, err error) { + err = appDb.QueryRowContext(context, "select count(*) from posts").Scan(&count) return }