Skip to content

Commit 3371145

Browse files
authored
chore: update to go1.22 (go-acme#2144)
1 parent 874e3ea commit 3371145

File tree

58 files changed

+18
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+18
-87
lines changed

.github/workflows/go-cross.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
go-version: [ stable, oldstable ]
19+
go-version: [ stable ]
2020
os: [ubuntu-latest, macos-latest, windows-latest]
2121

2222
steps:

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
env:
1515
GO_VERSION: stable
16-
GOLANGCI_LINT_VERSION: v1.56.1
16+
GOLANGCI_LINT_VERSION: v1.57.1
1717
HUGO_VERSION: 0.117.0
1818
CGO_ENABLED: 0
1919
LEGO_E2E_TESTS: CI

.golangci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
run:
22
timeout: 10m
3-
skip-files: []
43

54
linters-settings:
65
govet:
7-
check-shadowing: true
6+
enable:
7+
- shadow
88
gocyclo:
99
min-complexity: 12
1010
goconst:
@@ -139,6 +139,7 @@ linters:
139139
- nonamedreturns
140140
- musttag # false-positive https://github.com/junk1tm/musttag/issues/17
141141
- gosmopolitan # not relevant
142+
- exportloopref # Useless with go1.22
142143

143144
issues:
144145
exclude-use-default: false
@@ -148,7 +149,7 @@ issues:
148149
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked'
149150
- 'exported (type|method|function) (.+) should have comment or be unexported'
150151
- 'ST1000: at least one file in a package should have a package comment'
151-
- 'fmt.Sprintf can be replaced with string addition'
152+
- 'fmt.Sprintf can be replaced with string'
152153
exclude-rules:
153154
- path: (.+)_test.go
154155
linters:

acme/api/order_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ func TestOrderService_NewWithOptions(t *testing.T) {
9494
}
9595

9696
for _, test := range testCases {
97-
test := test
9897
t.Run(test.desc, func(t *testing.T) {
9998
t.Parallel()
10099

acme/api/service_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ func Test_getLink(t *testing.T) {
4444
}
4545

4646
for _, test := range testCases {
47-
test := test
4847
t.Run(test.desc, func(t *testing.T) {
4948
t.Parallel()
5049

certcrypto/crypto_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ func TestGenerateCSR(t *testing.T) {
8686
}
8787

8888
for _, test := range testCases {
89-
test := test
9089
t.Run(test.desc, func(t *testing.T) {
9190
t.Parallel()
9291

certificate/authorization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (c *Certifier) getAuthorizations(order acme.ExtendedOrder) ([]acme.Authoriz
3838
var responses []acme.Authorization
3939

4040
failures := newObtainError()
41-
for i := 0; i < len(order.Authorizations); i++ {
41+
for range len(order.Authorizations) {
4242
select {
4343
case res := <-resc:
4444
responses = append(responses, res)

certificate/renewal_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ func TestCertifier_GetRenewalInfo_errors(t *testing.T) {
112112
}
113113

114114
for _, test := range testCases {
115-
test := test
116115
t.Run(test.desc, func(t *testing.T) {
117116
t.Parallel()
118117

challenge/dns01/dns_challenge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func getChallengeFQDN(domain string, followCNAME bool) string {
215215
}
216216

217217
// recursion counter so it doesn't spin out of control
218-
for limit := 0; limit < 50; limit++ {
218+
for range 50 {
219219
// Keep following CNAMEs
220220
r, err := dnsQuery(fqdn, dns.TypeCNAME, recursiveNameservers, true)
221221

challenge/dns01/domain_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ func TestExtractSubDomain(t *testing.T) {
4747
}
4848

4949
for _, test := range testCases {
50-
test := test
5150
t.Run(test.desc, func(t *testing.T) {
5251
t.Parallel()
5352

@@ -93,7 +92,6 @@ func TestExtractSubDomain_errors(t *testing.T) {
9392
}
9493

9594
for _, test := range testCases {
96-
test := test
9795
t.Run(test.desc, func(t *testing.T) {
9896
t.Parallel()
9997

0 commit comments

Comments
 (0)