From ebac8c65d06374f6365b311078471642daf2579f Mon Sep 17 00:00:00 2001 From: Brian Zimmer Date: Sun, 17 Oct 2021 19:56:32 -0700 Subject: [PATCH] moved activities iterator to package scope --- strava/activity.go | 2 +- strava/activity_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/strava/activity.go b/strava/activity.go index f90b5d8..1cd1f4c 100644 --- a/strava/activity.go +++ b/strava/activity.go @@ -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 diff --git a/strava/activity_test.go b/strava/activity_test.go index df2bc5d..8dcfe29 100644 --- a/strava/activity_test.go +++ b/strava/activity_test.go @@ -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)