From 80bebda69c8300c40dfd08d6555ac589d51c0b8f Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Mon, 20 Dec 2021 13:40:17 +0100 Subject: [PATCH] Fix code style issue --- acme/order.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/acme/order.go b/acme/order.go index 1ef0409c..1fa0809e 100644 --- a/acme/order.go +++ b/acme/order.go @@ -300,19 +300,15 @@ func canonicalize(csr *x509.CertificateRequest) (canonicalized *x509.Certificate // If these were excluded, a certificate could contain an IP as the // common name without having been challenged. if csr.Subject.CommonName != "" { - ip := net.ParseIP(csr.Subject.CommonName) - subjectIsIP := ip != nil - if subjectIsIP { - // nolint:gocritic - canonicalized.IPAddresses = append(csr.IPAddresses, ip) + if ip := net.ParseIP(csr.Subject.CommonName); ip != nil { + canonicalized.IPAddresses = append(canonicalized.IPAddresses, ip) } else { - // nolint:gocritic - canonicalized.DNSNames = append(csr.DNSNames, csr.Subject.CommonName) + canonicalized.DNSNames = append(canonicalized.DNSNames, csr.Subject.CommonName) } } - canonicalized.DNSNames = uniqueSortedLowerNames(csr.DNSNames) - canonicalized.IPAddresses = uniqueSortedIPs(csr.IPAddresses) + canonicalized.DNSNames = uniqueSortedLowerNames(canonicalized.DNSNames) + canonicalized.IPAddresses = uniqueSortedIPs(canonicalized.IPAddresses) return canonicalized }