From 49dacb2db1fbe0554a4c26fa29a3071c91b289dd Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sun, 6 Oct 2024 20:01:31 +0200 Subject: [PATCH] fix: go1.22 compatibility (#2295) --- .github/workflows/go-cross.yml | 2 +- challenge/dns01/nameserver.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index bcfdc62aa..30ec652a2 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - go-version: [ stable ] + go-version: [ oldstable, stable ] os: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/challenge/dns01/nameserver.go b/challenge/dns01/nameserver.go index a2149b3f9..a8d678af2 100644 --- a/challenge/dns01/nameserver.go +++ b/challenge/dns01/nameserver.go @@ -48,7 +48,11 @@ func (cache *soaCacheEntry) isExpired() bool { // ClearFqdnCache clears the cache of fqdn to zone mappings. Primarily used in testing. func ClearFqdnCache() { - fqdnSoaCache.Clear() + // TODO(ldez): use `fqdnSoaCache.Clear()` when updating to go1.23 + fqdnSoaCache.Range(func(k, v any) bool { + fqdnSoaCache.Delete(k) + return true + }) } func AddDNSTimeout(timeout time.Duration) ChallengeOption {