pkg/ghclient/wrappers.go
func (c *Client) GetCollaborators(org, repo string) ([]*github.User, error) {
	opts := &github.ListCollaboratorsOptions{}
	collaborators, err := c.depaginate(
		fmt.Sprintf("getting collaborators for '%s/%s'", org, repo),
		&opts.ListOptions,
		func() ([]interface{}, *github.Response, error) {
			page, resp, err := c.repoService.ListCollaborators(context.Background(), org, repo, opts)

			var interfaceList []interface{}
			if err == nil {
				interfaceList = make([]interface{}, 0, len(page))
				for _, user := range page {
					interfaceList = append(interfaceList, user)
				}
			}
			return interfaceList, resp, err
		},
	)

	result := make([]*github.User, 0, len(collaborators))
	for _, user := range collaborators {
		result = append(result, user.(*github.User))
	}
	return result, err
}
func (c *Client) GetCollaborators(org, repo string) ([]*github.User, error) {
	opts := &github.ListCollaboratorsOptions{}
	collaborators, err := c.depaginate(
		fmt.Sprintf("getting collaborators for '%s/%s'", org, repo),
		&opts.ListOptions,
		func() ([]interface{}, *github.Response, error) {
			page, resp, err := c.repoService.ListCollaborators(context.Background(), org, repo, opts)

			var interfaceList []interface{}
			if err == nil {
				interfaceList = make([]interface{}, 0, len(page))
				for _, user := range page {
					interfaceList = append(interfaceList, user)
				}
			}
			return interfaceList, resp, err
		},
	)

	result := make([]*github.User, 0, len(collaborators))
	for _, user := range collaborators {
		result = append(result, user.(*github.User))
	}
	return result, err
}
func ( c * Client ) GetCollaborators ( org , repo string ) ( [ ] * github . User , error ) { opts := & github . ListCollaboratorsOptions { } collaborators , err := c . depaginate ( fmt . Sprintf ( " " , org , repo ) , & opts . ListOptions , func ( ) ( [ ] interface { } , * github . Response , error ) { page , resp , err := c . repoService . ListCollaborators ( context . Background ( ) , org , repo , opts ) var interfaceList [ ] interface { } if err == nil { interfaceList = make ( [ ] interface { } , 0 , len ( page ) ) for _ , user := range page { interfaceList = append ( interfaceList , user ) } } return interfaceList , resp , err } , ) result := make ( [ ] * github . User , 0 , len ( collaborators ) ) for _ , user := range collaborators { result = append ( result , user . ( * github . User ) ) } return result , err }
// GetCollaborators returns all github users who are members or outside collaborators of the repo.
GetCollaborators returns all github users who are members or outside collaborators of the repo .