From 59192c62b115633fd6b29095433e6f3cde12aa69 Mon Sep 17 00:00:00 2001 From: Timothy Date: Tue, 26 Nov 2024 08:55:11 +0800 Subject: [PATCH] format the code --- internal/handler/handler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 5c92a39a..10f8d72a 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -104,9 +104,10 @@ func (handler *Handler) UpdateIP(domain *settings.Domain) error { func (handler *Handler) updateDNS(domain *settings.Domain, ip string) error { var updatedDomains []string - for _, subdomainName := range domain.SubDomains { + for _, subdomainName := range domain.SubDomains { var hostname string + if subdomainName != utils.RootDomain { hostname = subdomainName + "." + domain.DomainName } else { @@ -119,7 +120,7 @@ func (handler *Handler) updateDNS(domain *settings.Domain, ip string) error { continue } - //check against the current known IP, if no change, skip update + // check against the current known IP, if no change, skip update if ip == lastIP { log.Infof("IP is the same as cached one (%s). Skip update.", ip) } else {