Skip to content

Commit 1db9c9e

Browse files
authored
Merge pull request #10 from luhring/small-docs-fixes
Minor fixes to doc comments
2 parents 779b58b + 46b8673 commit 1db9c9e

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

pkg/csaf/csaf.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (branch *ProductBranch) FindFirstProduct() string {
7171
return branch.Product.ID
7272
}
7373

74-
// No noested branches
74+
// No nested branches
7575
if branch.Branches == nil {
7676
return ""
7777
}
@@ -85,7 +85,7 @@ func (branch *ProductBranch) FindFirstProduct() string {
8585
return ""
8686
}
8787

88-
// FindFirstProduct recursively searches for the first product in the tree
88+
// FindProductIdentifier recursively searches for the first product identifier in the tree
8989
func (branch *ProductBranch) FindProductIdentifier(helperType, helperValue string) *Product {
9090
if len(branch.Product.IdentificationHelper) != 0 {
9191
for k := range branch.Product.IdentificationHelper {
@@ -98,7 +98,7 @@ func (branch *ProductBranch) FindProductIdentifier(helperType, helperValue strin
9898
}
9999
}
100100

101-
// No noested branches
101+
// No nested branches
102102
if branch.Branches == nil {
103103
return nil
104104
}

pkg/vex/statement.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import (
1212
"time"
1313
)
1414

15-
// A Statement is a declaration conveying a single [status] for a single [vul_id] for one or more [product_id]s. A VEX Statement exists within a VEX Document.
15+
// A Statement is a declaration conveying a single [status] for a single
16+
// [vul_id] for one or more [product_id]s. A VEX Statement exists within a VEX
17+
// Document.
1618
type Statement struct {
1719
// [vul_id] SHOULD use existing and well known identifiers, for example:
1820
// CVE, the Global Security Database (GSD), or a supplier’s vulnerability

pkg/vex/vex.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,11 @@ func (vexDoc *VEX) GenerateCanonicalID() (string, error) {
322322
return vexDoc.ID, nil
323323
}
324324

325+
// DateFromEnv returns a time object representing the time specified in the
326+
// `SOURCE_DATE_EPOCH` environment variable, whose value can be specified as
327+
// either UNIX seconds or as a RFC3339 value.
325328
func DateFromEnv() (*time.Time, error) {
326-
// Support envvar for reproducible vexing
329+
// Support env var for reproducible vexing
327330
d := os.Getenv("SOURCE_DATE_EPOCH")
328331
if d == "" {
329332
return nil, nil
@@ -336,7 +339,7 @@ func DateFromEnv() (*time.Time, error) {
336339
} else {
337340
t, err = time.Parse(time.RFC3339, d)
338341
if err != nil {
339-
return nil, fmt.Errorf("failed to parse envvar SOURCE_DATE_EPOCH: %w", err)
342+
return nil, fmt.Errorf("failed to parse env var SOURCE_DATE_EPOCH: %w", err)
340343
}
341344
}
342345
return &t, nil

0 commit comments

Comments
 (0)