Use individual structs for services

Made it this way so that I can use the PostAndCommentService as a child
of the PostService and CommentService.

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-07-21 23:05:24 -04:00
parent 977a222d66
commit 2ea893ab16
16 changed files with 476 additions and 264 deletions
+3 -1
View File
@@ -12,7 +12,9 @@ import (
// related methods of the Reddit API.
//
// Reddit API docs: https://www.reddit.com/dev/api/#section_listings
type ListingsService service
type ListingsService struct {
client *Client
}
// Get returns posts, comments, and subreddits from their IDs.
func (s *ListingsService) Get(ctx context.Context, ids ...string) ([]*Post, []*Comment, []*Subreddit, *Response, error) {