MCPcopy Index your code
hub / github.com/google/go-github / ListContributors

Method ListContributors

github/repos.go:915–934  ·  view source on GitHub ↗

ListContributors lists contributors for a repository. GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-repository-contributors meta:operation GET /repos/{owner}/{repo}/contributors

(ctx context.Context, owner, repository string, opts *ListContributorsOptions)

Source from the content-addressed store, hash-verified

913//
914//meta:operation GET /repos/{owner}/{repo}/contributors
915func (s *RepositoriesService) ListContributors(ctx context.Context, owner, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) {
916 u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository)
917 u, err := addOptions(u, opts)
918 if err != nil {
919 return nil, nil, err
920 }
921
922 req, err := s.client.NewRequest(ctx, "GET", u, nil)
923 if err != nil {
924 return nil, nil, err
925 }
926
927 var contributor []*Contributor
928 resp, err := s.client.Do(req, &contributor)
929 if err != nil {
930 return nil, resp, err
931 }
932
933 return contributor, resp, nil
934}
935
936// ListLanguages lists languages for the specified repository. The returned map
937// specifies the languages and the number of bytes of code written in that

Calls 3

addOptionsFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 1