From 4ed61fdcac9ebd49143d425d1facd41b3c1ffeaa Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 11 Nov 2024 01:25:17 +0100 Subject: [PATCH] chore: domain merge simplification --- cmd/cmd_renew.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cmd/cmd_renew.go b/cmd/cmd_renew.go index 496f5a4335..1f9c081681 100644 --- a/cmd/cmd_renew.go +++ b/cmd/cmd_renew.go @@ -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 }