func (c *Client) GetMembers(cfg *config.Members) (*slackduty.Members, error) {
	members := &slackduty.Members{}
	eg := errgroup.Group{}

	if cfg.Pagerduty != nil {
		eg.Go(func() error {
			err := c.getPagerDutyMembers(cfg.Pagerduty, members)
			if err != nil {
				c.logger.Error("failed to get PagerDuty members", zap.Error(err))
				return err
			}

			return nil
		})
	}

	if cfg.Slack != nil {
		eg.Go(func() error {
			err := c.getSlackUsers(cfg.Slack, members)
			if err != nil {
				c.logger.Error("failed to get Slack members", zap.Error(err))
				return err
			}

			return nil
		})
	}

	if err := eg.Wait(); err != nil {
		return nil, err
	}

	return members, nil
}
// GetMembers get all members that should be a member of the usergroup(s)
// For can specify Slack user and Pagerduty users, teams, services and also
// schedules.
GetMembers get all members that should be a member of the usergroup(s)
For can specify Slack user and Pagerduty users, teams, services and also
schedules.
// GetMembers get all members that should be a member of the usergroup ( s ) // For can specify Slack user and Pagerduty users teams services and also // schedules .
func (c *Client) GetMembers(cfg *config.Members) (*slackduty.Members, error) {
	members := &slackduty.Members{}
	eg := errgroup.Group{}
	if cfg.Pagerduty != nil {
		eg.Go(func() error {
			err := c.getPagerDutyMembers(cfg.Pagerduty, members)
			if err != nil {
				c.logger.Error("failed to get PagerDuty members", zap.Error(err))
				return err
			}
			return nil
		})
	}
	if cfg.Slack != nil {
		eg.Go(func() error {
			err := c.getSlackUsers(cfg.Slack, members)
			if err != nil {
				c.logger.Error("failed to get Slack members", zap.Error(err))
				return err
			}
			return nil
		})
	}
	if err := eg.Wait(); err != nil {
		return nil, err
	}
	return members, nil
}
func ( c * Client ) GetMembers ( cfg * config . Members ) ( * slackduty . Members , error ) { members := & slackduty . Members { } eg := errgroup . Group { } if cfg . Pagerduty != nil { eg . Go ( func ( ) error { err := c . getPagerDutyMembers ( cfg . Pagerduty , members ) if err != nil { c . logger . Error ( " " , zap . Error ( err ) ) return err } return nil } ) } if cfg . Slack != nil { eg . Go ( func ( ) error { err := c . getSlackUsers ( cfg . Slack , members ) if err != nil { c . logger . Error ( " " , zap . Error ( err ) ) return err } return nil } ) } if err := eg . Wait ( ) ; err != nil { return nil , err } return members , nil }
GetMembers get all members that should be a member of the usergroup(s)
For can specify Slack user and Pagerduty users, teams, services and also
schedules.
GetMembers get all members that should be a member of the usergroup ( s ) For can specify Slack user and Pagerduty users teams services and also schedules .