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)
| 31 | // |
| 32 | //meta:operation GET /codes_of_conduct |
| 33 | func (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 | // |
no test coverage detected