Skip to content

Commit c82a346

Browse files
tatianabTatiana Bradley
authored andcommitted
internal/issues: update function comments
Updates function comments to reflect removal of Client interface. Change-Id: I1276f3e20f64c32ba671a419059e1def35cf3e5e Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/459575 Reviewed-by: Tatiana Bradley <[email protected]> Run-TryBot: Tatiana Bradley <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Julie Qiu <[email protected]>
1 parent 143de28 commit c82a346

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

internal/issues/issues.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"golang.org/x/vulndb/internal/derrors"
1818
)
1919

20-
// An Issue represents a GitHub issue or similar.
20+
// Issue represents a GitHub issue.
2121
type Issue struct {
2222
Number int
2323
Title string
@@ -80,17 +80,17 @@ func NewTestClient(cfg *Config, baseURL *url.URL) *Client {
8080
return c
8181
}
8282

83-
// Destination implements Client.Destination.
83+
// Destination returns the URL of the Github repo.
8484
func (c *Client) Destination() string {
8585
return fmt.Sprintf("https://github.com/%s/%s", c.owner, c.repo)
8686
}
8787

88-
// Reference implements Client.Reference.
88+
// Reference returns the URL of the given issue.
8989
func (c *Client) Reference(num int) string {
9090
return fmt.Sprintf("%s/issues/%d", c.Destination(), num)
9191
}
9292

93-
// IssueExists implements Client.IssueExists.
93+
// IssueExists reports whether an issue with the given ID exists.
9494
func (c *Client) IssueExists(ctx context.Context, number int) (_ bool, err error) {
9595
defer derrors.Wrap(&err, "IssueExists(%d)", number)
9696

@@ -105,7 +105,7 @@ func (c *Client) IssueExists(ctx context.Context, number int) (_ bool, err error
105105
return false, nil
106106
}
107107

108-
// convertGithubIssueToIssue converts the github.Issue type to our Issue type
108+
// convertGithubIssueToIssue converts a github.Issue to an Issue.
109109
func convertGithubIssueToIssue(ghIss *github.Issue) *Issue {
110110
iss := &Issue{}
111111
if ghIss.Number != nil {
@@ -135,7 +135,7 @@ func convertGithubIssueToIssue(ghIss *github.Issue) *Issue {
135135
return iss
136136
}
137137

138-
// GetIssue implements Client.GetIssue.
138+
// GetIssue returns the issue with the given issue number.
139139
func (c *Client) GetIssue(ctx context.Context, number int) (_ *Issue, err error) {
140140
defer derrors.Wrap(&err, "GetIssue(%d)", number)
141141
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)
147147
return iss, nil
148148
}
149149

150-
// GetIssues implements Client.GetIssues
150+
// GetIssues returns all Github issues that match the filters in opts.
151151
func (c *Client) GetIssues(ctx context.Context, opts GetIssuesOptions) (_ []*Issue, err error) {
152152
defer derrors.Wrap(&err, "GetIssues()")
153153
clientOpts := &github.IssueListByRepoOptions{
@@ -179,7 +179,7 @@ func (c *Client) GetIssues(ctx context.Context, opts GetIssuesOptions) (_ []*Iss
179179
return issues, nil
180180
}
181181

182-
// CreateIssue implements Client.CreateIssue.
182+
// CreateIssue creates a new issue.
183183
func (c *Client) CreateIssue(ctx context.Context, iss *Issue) (number int, err error) {
184184
defer derrors.Wrap(&err, "CreateIssue(%s)", iss.Title)
185185

0 commit comments

Comments
 (0)