Skip to content

Commit c7ec463

Browse files
cuishuanggopherbot
authored andcommitted
internal: make function and struct comments match the names
Change-Id: Id996816dd5552fcf202c283f4a921df9a5d5eeee Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/638777 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
1 parent 854d032 commit c7ec463

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

internal/gitrepo/gitrepo.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func Clone(ctx context.Context, repoURL string) (repo *git.Repository, err error
3333
return CloneAt(ctx, repoURL, plumbing.HEAD)
3434
}
3535

36-
// Clone returns a bare repo by cloning the repo at repoURL at the given ref.
36+
// CloneAt returns a bare repo by cloning the repo at repoURL at the given ref.
3737
func CloneAt(ctx context.Context, repoURL string, ref plumbing.ReferenceName) (repo *git.Repository, err error) {
3838
log.Infof(ctx, "Cloning repo %q at %s", repoURL, ref)
3939
return git.Clone(memory.NewStorage(), nil, &git.CloneOptions{
@@ -103,7 +103,7 @@ func Root(repo *git.Repository) (root *object.Tree, err error) {
103103
return RootAt(repo, head)
104104
}
105105

106-
// Root returns the root tree of the repo at the given commit.
106+
// RootAt returns the root tree of the repo at the given commit.
107107
func RootAt(repo *git.Repository, commit *object.Commit) (root *object.Tree, err error) {
108108
return repo.TreeObject(commit.TreeHash)
109109
}

internal/internal.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"golang.org/x/vulndb/internal/derrors"
1414
)
1515

16-
// Readfilelines reads and returns the lines from a file.
16+
// ReadFileLines reads and returns the lines from a file.
1717
// Whitespace on each line is trimmed.
1818
// Blank lines and lines beginning with '#' are ignored.
1919
func ReadFileLines(filename string) (lines []string, err error) {

internal/report/report.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ func (r *Report) AllCVEs() []string {
489489
return all
490490
}
491491

492-
// AllPkgs returns all affected packages in a given module.
492+
// AllPackages returns all affected packages in a given module.
493493
func (m *Module) AllPackages() map[string]*Package {
494494
pkgs := make(map[string]*Package)
495495
for _, pkg := range m.Packages {

internal/worker/store/mem_store.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (ms *MemStore) ListCommitUpdateRecords(_ context.Context, limit int) ([]*Co
8282
return urs, nil
8383
}
8484

85-
// GetCVE4Record implements store.GetCVE4Record.
85+
// GetRecord implements store.GetCVE4Record.
8686
func (ms *MemStore) GetRecord(_ context.Context, id string) (Record, error) {
8787
switch {
8888
case idstr.IsGHSA(id):
@@ -132,7 +132,7 @@ type memTransaction struct {
132132
ms *MemStore
133133
}
134134

135-
// SetCVE4Record implements Transaction.SetCVE4Record.
135+
// SetRecord implements Transaction.SetCVE4Record.
136136
func (tx *memTransaction) SetRecord(r Record) error {
137137
if err := r.Validate(); err != nil {
138138
return err
@@ -198,7 +198,7 @@ func (tx *memTransaction) CreateRecord(r Record) error {
198198
}
199199
}
200200

201-
// GetLegacyGHSARecord implements Transaction.GetLegacyGHSARecord.
201+
// GetRecord implements Transaction.GetLegacyGHSARecord.
202202
func (tx *memTransaction) GetRecord(id string) (Record, error) {
203203
switch {
204204
case idstr.IsGHSA(id):

internal/worker/store/store.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type CVE4Record struct {
2323
ID string
2424
// Path is the path to the CVE file in the repo.
2525
Path string
26-
// Blobhash is the hash of the CVE's blob in repo, for quick change detection.
26+
// BlobHash is the hash of the CVE's blob in repo, for quick change detection.
2727
BlobHash string
2828
// CommitHash is the commit of the cvelist repo from which this information came.
2929
CommitHash string
@@ -261,7 +261,7 @@ type Transaction interface {
261261
// If not found, it returns (nil, nil).
262262
GetRecord(id string) (Record, error)
263263

264-
// GetRecords retrieves records for all CVE IDs between startID and
264+
// GetCVE4Records retrieves records for all CVE IDs between startID and
265265
// endID, inclusive.
266266
GetCVE4Records(startID, endID string) ([]*CVE4Record, error)
267267

0 commit comments

Comments
 (0)