Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56c70f3

Browse files
committed
Update to Go 1.18; use any
1 parent 46a4436 commit 56c70f3

7 files changed

Lines changed: 9 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ ubuntu-latest, macos-latest, windows-latest ]
18-
go: [ '1.17' ]
18+
go: [ '1.18' ]
1919

2020
runs-on: ${{ matrix.os }}
2121

certmagic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ type IssuedCertificate struct {
405405

406406
// Any extra information to serialize alongside the
407407
// certificate in storage.
408-
Metadata interface{}
408+
Metadata any
409409
}
410410

411411
// CertificateResource associates a certificate with its private
@@ -425,7 +425,7 @@ type CertificateResource struct {
425425

426426
// Any extra information associated with the certificate,
427427
// usually provided by the issuer implementation.
428-
IssuerData interface{} `json:"issuer_data,omitempty"`
428+
IssuerData any `json:"issuer_data,omitempty"`
429429

430430
// The unique string identifying the issuer of the
431431
// certificate; internally useful for storage access.

config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type Config struct {
5656
// to subscribe to certain things happening
5757
// internally by this config; invocations are
5858
// synchronous, so make them return quickly!
59-
OnEvent func(event string, data interface{})
59+
OnEvent func(event string, data any)
6060

6161
// DefaultServerName specifies a server name
6262
// to use when choosing a certificate if the
@@ -1070,7 +1070,7 @@ func (cfg *Config) managedCertNeedsRenewal(certRes CertificateResource) (time.Du
10701070
return remaining, needsRenew
10711071
}
10721072

1073-
func (cfg *Config) emit(eventName string, data interface{}) {
1073+
func (cfg *Config) emit(eventName string, data any) {
10741074
if cfg.OnEvent == nil {
10751075
return
10761076
}

config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func TestSaveCertResource(t *testing.T) {
6262
}
6363

6464
// the result of our test will be a map, since we have
65-
// no choice but to decode it into an interface
66-
cert.IssuerData = map[string]interface{}{
65+
// no choice but to decode it into an 'any' interface
66+
cert.IssuerData = map[string]any{
6767
"url": "https://example.com/cert",
6868
}
6969

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/caddyserver/certmagic
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/klauspost/cpuid/v2 v2.0.11

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
4343
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
4444
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
4545
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
46-
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
4746
golang.org/x/net v0.0.0-20220630215102-69896b714898 h1:K7wO6V1IrczY9QOQ2WkVpw4JQSwCd52UsxVEirZUfiw=
4847
golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
4948
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

solvers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ var (
690690
// data that can make it easier or more efficient to solve.
691691
type Challenge struct {
692692
acme.Challenge
693-
data interface{}
693+
data any
694694
}
695695

696696
// challengeKey returns the map key for a given challenge; it is the identifier

0 commit comments

Comments
 (0)