// ReadActivities reads the activities from the given iterator up to a maximum number
// specified by maxItems. If maxItems <= 0 then all activities are read.
ReadActivities reads the activities from the given iterator up to a maximum number
specified by maxItems. If maxItems <= 0 then all activities are read.
// ReadActivities reads the activities from the given iterator up to a maximum number // specified by maxItems . If maxItems < = 0 then all activities are read .
func ReadActivities(it ActivityIterator, maxItems int) ([]*vocab.ActivityType, error) {
	var activities []*vocab.ActivityType
	for maxItems <= 0 || len(activities) < maxItems {
		activity, err := it.Next()
		if err != nil {
			if errors.Is(err, ErrNotFound) {
				break
			}
			return nil, err
		}
		activities = append(activities, activity)
	}
	return activities, nil
}
func ReadActivities ( it ActivityIterator , maxItems int ) ( [ ] * vocab . ActivityType , error ) { var activities [ ] * vocab . ActivityType for maxItems <= 0 || len ( activities ) < maxItems { activity , err := it . Next ( ) if err != nil { if errors . Is ( err , ErrNotFound ) { break } return nil , err } activities = append ( activities , activity ) } return activities , nil }
ReadActivities reads the activities from the given iterator up to a maximum number
specified by maxItems.
ReadActivities reads the activities from the given iterator up to a maximum number specified by maxItems .