Get more replies to a comment via /api/morechildren
Also started using slices of pointers instead of slices of structs. This is useful especially in the case of adding to the list of replies of a comment. If the comment is a plain old struct (non-pointer), the change wouldn't happen Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
+2
-2
@@ -15,7 +15,7 @@ import (
|
||||
type ListingsService service
|
||||
|
||||
// Get returns posts, comments, and subreddits from their IDs.
|
||||
func (s *ListingsService) Get(ctx context.Context, ids ...string) ([]Post, []Comment, []Subreddit, *Response, error) {
|
||||
func (s *ListingsService) Get(ctx context.Context, ids ...string) ([]*Post, []*Comment, []*Subreddit, *Response, error) {
|
||||
type query struct {
|
||||
IDs []string `url:"id,comma"`
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func (s *ListingsService) Get(ctx context.Context, ids ...string) ([]Post, []Com
|
||||
}
|
||||
|
||||
// GetPosts returns posts from their full IDs.
|
||||
func (s *ListingsService) GetPosts(ctx context.Context, ids ...string) ([]Post, *Response, error) {
|
||||
func (s *ListingsService) GetPosts(ctx context.Context, ids ...string) ([]*Post, *Response, error) {
|
||||
if len(ids) == 0 {
|
||||
return nil, nil, errors.New("must provide at least 1 id")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user