Skip to content

Commit

Permalink
Merge pull request #8 from bzimmer/iter
Browse files Browse the repository at this point in the history
moved activities iterator to package scope
  • Loading branch information
bzimmer authored Oct 18, 2021
2 parents 0150f4f + ebac8c6 commit 2be3eb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion strava/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (s *ActivityService) Activities(ctx context.Context, spec activity.Paginati
}

// ActivitiesIter executes the iter function over the results of the channel
func (s *ActivityService) ActivitiesIter(res <-chan *ActivityResult, iter ActivityIterFunc) error {
func ActivitiesIter(res <-chan *ActivityResult, iter ActivityIterFunc) error {
for ar := range res {
if ar.Err != nil {
return ar.Err
Expand Down
2 changes: 1 addition & 1 deletion strava/activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

func readall(ctx context.Context, client *strava.Client, spec activity.Pagination, opts ...strava.APIOption) ([]*strava.Activity, error) {
var activities []*strava.Activity
err := client.Activity.ActivitiesIter(
err := strava.ActivitiesIter(
client.Activity.Activities(ctx, spec, opts...),
func(act *strava.Activity) (bool, error) {
activities = append(activities, act)
Expand Down

0 comments on commit 2be3eb5

Please sign in to comment.