Skip to content

Commit da7b64c

Browse files
committed
Improved Reddit.addQueue() method by removing the returning value.
Signed-off-by: Sandy <thecsw@ku.edu>
1 parent 51adc35 commit da7b64c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

reddit.go

+11-7
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,28 @@ func (c *Reddit) MiraRequest(method string, target string, payload map[string]st
4141
}
4242

4343
func (c *Reddit) Me() *Reddit {
44-
return c.addQueue(c.Creds.Username, "me")
44+
c.addQueue(c.Creds.Username, "me")
45+
return c
4546
}
4647

4748
func (c *Reddit) Subreddit(name ...string) *Reddit {
48-
return c.addQueue(strings.Join(name, "+"), "subreddit")
49+
c.addQueue(strings.Join(name, "+"), "subreddit")
50+
return c
4951
}
5052

5153
func (c *Reddit) Submission(name string) *Reddit {
52-
return c.addQueue(name, "submission")
54+
c.addQueue(name, "submission")
55+
return c
5356
}
5457

5558
func (c *Reddit) Comment(name string) *Reddit {
56-
return c.addQueue(name, "comment")
59+
c.addQueue(name, "comment")
60+
return c
5761
}
5862

5963
func (c *Reddit) Redditor(name string) *Reddit {
60-
return c.addQueue(name, "redditor")
64+
c.addQueue(name, "redditor")
65+
return c
6166
}
6267

6368
func (c *Reddit) Submissions(sort string, tdur string, limit int) ([]models.PostListingChild, error) {
@@ -563,9 +568,8 @@ func (c *Reddit) checkType(rtype ...string) (string, string, error) {
563568
return name, ttype, nil
564569
}
565570

566-
func (c *Reddit) addQueue(name string, ttype string) *Reddit {
571+
func (c *Reddit) addQueue(name string, ttype string) {
567572
c.Chain = append(c.Chain, ChainVals{Name: name, Type: ttype})
568-
return c
569573
}
570574

571575
func (c *Reddit) getQueue() (string, string) {

0 commit comments

Comments
 (0)