Rename method

This commit is contained in:
Jan-Lukas Else 2020-08-24 21:19:36 +02:00
parent a4a01d2c67
commit b60fce2fbb
1 changed files with 3 additions and 3 deletions

View File

@ -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
}