mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
chore: domain merge simplification (#2340)
This commit is contained in:
parent
98371c4695
commit
a7aaae4abe
1 changed files with 6 additions and 9 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"errors"
|
||||
"math/rand"
|
||||
"os"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/go-acme/lego/v4/acme/api"
|
||||
|
|
@ -377,16 +378,12 @@ func addPathToMetadata(meta map[string]string, domain string, certRes *certifica
|
|||
|
||||
func merge(prevDomains, nextDomains []string) []string {
|
||||
for _, next := range nextDomains {
|
||||
var found bool
|
||||
for _, prev := range prevDomains {
|
||||
if prev == next {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
prevDomains = append(prevDomains, next)
|
||||
if slices.Contains(prevDomains, next) {
|
||||
continue
|
||||
}
|
||||
|
||||
prevDomains = append(prevDomains, next)
|
||||
}
|
||||
|
||||
return prevDomains
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue