@@ -17,7 +17,7 @@ import (
17
17
"golang.org/x/vulndb/internal/derrors"
18
18
)
19
19
20
- // An Issue represents a GitHub issue or similar .
20
+ // Issue represents a GitHub issue.
21
21
type Issue struct {
22
22
Number int
23
23
Title string
@@ -80,17 +80,17 @@ func NewTestClient(cfg *Config, baseURL *url.URL) *Client {
80
80
return c
81
81
}
82
82
83
- // Destination implements Client.Destination .
83
+ // Destination returns the URL of the Github repo .
84
84
func (c * Client ) Destination () string {
85
85
return fmt .Sprintf ("https://github.com/%s/%s" , c .owner , c .repo )
86
86
}
87
87
88
- // Reference implements Client.Reference .
88
+ // Reference returns the URL of the given issue .
89
89
func (c * Client ) Reference (num int ) string {
90
90
return fmt .Sprintf ("%s/issues/%d" , c .Destination (), num )
91
91
}
92
92
93
- // IssueExists implements Client.IssueExists .
93
+ // IssueExists reports whether an issue with the given ID exists .
94
94
func (c * Client ) IssueExists (ctx context.Context , number int ) (_ bool , err error ) {
95
95
defer derrors .Wrap (& err , "IssueExists(%d)" , number )
96
96
@@ -105,7 +105,7 @@ func (c *Client) IssueExists(ctx context.Context, number int) (_ bool, err error
105
105
return false , nil
106
106
}
107
107
108
- // convertGithubIssueToIssue converts the github.Issue type to our Issue type
108
+ // convertGithubIssueToIssue converts a github.Issue to an Issue.
109
109
func convertGithubIssueToIssue (ghIss * github.Issue ) * Issue {
110
110
iss := & Issue {}
111
111
if ghIss .Number != nil {
@@ -135,7 +135,7 @@ func convertGithubIssueToIssue(ghIss *github.Issue) *Issue {
135
135
return iss
136
136
}
137
137
138
- // GetIssue implements Client.GetIssue .
138
+ // GetIssue returns the issue with the given issue number .
139
139
func (c * Client ) GetIssue (ctx context.Context , number int ) (_ * Issue , err error ) {
140
140
defer derrors .Wrap (& err , "GetIssue(%d)" , number )
141
141
ghIss , _ , err := c .client .Issues .Get (ctx , c .owner , c .repo , number )
@@ -147,7 +147,7 @@ func (c *Client) GetIssue(ctx context.Context, number int) (_ *Issue, err error)
147
147
return iss , nil
148
148
}
149
149
150
- // GetIssues implements Client.GetIssues
150
+ // GetIssues returns all Github issues that match the filters in opts.
151
151
func (c * Client ) GetIssues (ctx context.Context , opts GetIssuesOptions ) (_ []* Issue , err error ) {
152
152
defer derrors .Wrap (& err , "GetIssues()" )
153
153
clientOpts := & github.IssueListByRepoOptions {
@@ -179,7 +179,7 @@ func (c *Client) GetIssues(ctx context.Context, opts GetIssuesOptions) (_ []*Iss
179
179
return issues , nil
180
180
}
181
181
182
- // CreateIssue implements Client.CreateIssue .
182
+ // CreateIssue creates a new issue .
183
183
func (c * Client ) CreateIssue (ctx context.Context , iss * Issue ) (number int , err error ) {
184
184
defer derrors .Wrap (& err , "CreateIssue(%s)" , iss .Title )
185
185
0 commit comments