Skip to content

Commit

Permalink
remove unmatched named return
Browse files Browse the repository at this point in the history
  • Loading branch information
rmatsuoka committed Sep 13, 2023
1 parent d942f15 commit 75e520e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions import_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ func main() {
}
}

func fetchTweets(client *twitter2.Client, ids []string) (tweets []*twitter2.Tweet, err error) {
func fetchTweets(client *twitter2.Client, ids []string) ([]*twitter2.Tweet, error) {
// the `tweets` API accepts less than 100 tweets.
const N = 100
c := 0
var tweets []*twitter2.Tweet
for start := 0; start < len(ids); start += N {
end := start + N
if end > len(ids) {
Expand All @@ -156,5 +157,5 @@ func fetchTweets(client *twitter2.Client, ids []string) (tweets []*twitter2.Twee
// avoid `too many requests`
time.Sleep(time.Minute)
}
return
return tweets, nil
}

0 comments on commit 75e520e

Please sign in to comment.