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 baeaab5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ linters:
- bidichk
- bodyclose
- containedctx
- copyloopvar
- decorder
- dogsled
- dupword
- durationcheck
- errcheck
- errchkjson
- errorlint
- exportloopref
- forcetypeassert
- ginkgolinter
- gocheckcompilerdirectives
Expand Down
7 changes: 4 additions & 3 deletions ca/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ type chain struct {
}

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

func (c *chain) String() string {
Expand Down Expand Up @@ -380,6 +380,7 @@ func New(log *log.Logger, db *db.MemoryStore, ocspResponderURL string, alternate
prof.ValidityPeriod = defaultValidityPeriod
}
ca.profiles[name] = &prof
ca.log.Printf("Loaded profile %q with certificate validity period of %d seconds", name, prof.ValidityPeriod)
}

return ca
Expand Down Expand Up @@ -525,7 +526,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 baeaab5

Please sign in to comment.