mirror of
https://github.com/go-acme/lego.git
synced 2024-11-21 13:25:48 +02:00
chore: domain merge simplification (#2340)
This commit is contained in:
parent
98371c4695
commit
a7aaae4abe
@ -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…
Reference in New Issue
Block a user