...
1
2
3
4
5
6 package github
7
8 import (
9 "context"
10 "fmt"
11 )
12
13
14 type CodeownersErrors struct {
15 Errors []*CodeownersError `json:"errors"`
16 }
17
18
19 type CodeownersError struct {
20 Line int `json:"line"`
21 Column int `json:"column"`
22 Kind string `json:"kind"`
23 Source string `json:"source"`
24 Suggestion *string `json:"suggestion,omitempty"`
25 Message string `json:"message"`
26 Path string `json:"path"`
27 }
28
29
30
31
32 func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string) (*CodeownersErrors, *Response, error) {
33 u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo)
34 req, err := s.client.NewRequest("GET", u, nil)
35 if err != nil {
36 return nil, nil, err
37 }
38
39 codeownersErrors := &CodeownersErrors{}
40 resp, err := s.client.Do(ctx, req, codeownersErrors)
41 if err != nil {
42 return nil, resp, err
43 }
44
45 return codeownersErrors, resp, nil
46 }
47
View as plain text