func ecsNewListTasksIterator(ctx context.Context, c *ecs.Client, in *ecs.ListTasksInput) func(func(*ecs.ListTasksOutput, error) bool) { return func(yield func(*ecs.ListTasksOutput, error) bool) { for { out, err := c.ListTasks(ctx, in) if err != nil { yield(nil, err) return } if !yield(out, err) || out.NextToken == nil { return } in.NextToken = out.NextToken } } } client := ecs.NewFromConfig(awsCfg