Skip to content

Commit

Permalink
Rename desc->description, prevent loopvar aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongable committed Aug 21, 2024
1 parent f2f8a24 commit a5b345c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ca/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type chain struct {
}

type Profile struct {
Desc string
Description string
ValidityPeriod time.Duration
}

Expand Down Expand Up @@ -286,7 +286,7 @@ func (ca *CAImpl) newCertificate(domains []string, ips []net.IP, key crypto.Publ
}
}

certNotAfter := certNotBefore.Add(time.Duration(prof.ValidityPeriod-1) * time.Second)
certNotAfter := certNotBefore.Add((prof.ValidityPeriod - 1) * time.Second)

Check failure on line 289 in ca/ca.go

View workflow job for this annotation

GitHub Actions / go-lint-checks

Multiplication of durations: `(prof.ValidityPeriod - 1) * time.Second` (durationcheck)
maxNotAfter := time.Date(9999, 12, 31, 0, 0, 0, 0, time.UTC)
if certNotAfter.After(maxNotAfter) {
certNotAfter = maxNotAfter
Expand Down Expand Up @@ -525,7 +525,7 @@ func (ca *CAImpl) GetIntermediateKey(no int) *rsa.PrivateKey {
func (ca *CAImpl) GetProfiles() map[string]string {
res := make(map[string]string, len(ca.profiles))
for name, prof := range ca.profiles {
res[name] = prof.Desc
res[name] = prof.Description
}
return res
}
2 changes: 1 addition & 1 deletion cmd/pebble/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func main() {
if len(profiles) == 0 {
profiles = map[string]ca.Profile{
"default": {
Desc: "The default profile",
Description: "The default profile",
ValidityPeriod: 0, // Will be overridden by the CA's default
},
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/letsencrypt/pebble/v2

go 1.21
go 1.22

require (
github.com/go-jose/go-jose/v4 v4.0.1
Expand Down

0 comments on commit a5b345c

Please sign in to comment.