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

Method List

github/codesofconduct.go:33–48  ·  view source on GitHub ↗

List returns all codes of conduct. GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct?apiVersion=2022-11-28#get-all-codes-of-conduct meta:operation GET /codes_of_conduct

(ctx context.Context)

Source from the content-addressed store, hash-verified

31//
32//meta:operation GET /codes_of_conduct
33func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Response, error) {
34 req, err := s.client.NewRequest(ctx, "GET", "codes_of_conduct", nil)
35 if err != nil {
36 return nil, nil, err
37 }
38
39 req.Header.Set("Accept", mediaTypeCodesOfConductPreview)
40
41 var cs []*CodeOfConduct
42 resp, err := s.client.Do(req, &cs)
43 if err != nil {
44 return nil, resp, err
45 }
46
47 return cs, resp, nil
48}
49
50// ListCodesOfConduct returns all codes of conduct.
51//

Callers 1

ListCodesOfConductMethod · 0.45

Calls 2

NewRequestMethod · 0.80
DoMethod · 0.45

Tested by

no test coverage detected