mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
format code and fix the go lint warnings
This commit is contained in:
@@ -83,7 +83,7 @@ func (handler *CloudflareHandler) DomainLoop(domain *godns.Domain, panicChan cha
|
||||
}
|
||||
log.Println("Current IP is:", currentIP)
|
||||
//check against locally cached IP, if no change, skip update
|
||||
if (currentIP == lastIP){
|
||||
if currentIP == lastIP {
|
||||
log.Printf("IP is the same as cached one. Skip update.\n")
|
||||
} else {
|
||||
lastIP = currentIP
|
||||
|
||||
@@ -54,11 +54,11 @@ func (handler *DNSPodHandler) DomainLoop(domain *godns.Domain, panicChan chan<-
|
||||
log.Println("currentIP is:", currentIP)
|
||||
|
||||
//check against locally cached IP, if no change, skip update
|
||||
if (currentIP == lastIP){
|
||||
if currentIP == lastIP {
|
||||
log.Printf("IP is the same as cached one. Skip update.\n")
|
||||
}else{
|
||||
} else {
|
||||
lastIP = currentIP
|
||||
|
||||
|
||||
for _, subDomain := range domain.SubDomains {
|
||||
|
||||
subDomainID, ip := handler.GetSubDomain(domainID, subDomain)
|
||||
@@ -83,7 +83,7 @@ func (handler *DNSPodHandler) DomainLoop(domain *godns.Domain, panicChan chan<-
|
||||
log.Printf("%s.%s Current IP is same as domain IP, no need to update...\n", subDomain, domain.DomainName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Interval is 5 minutes
|
||||
log.Printf("Going to sleep, will start next checking in %d minutes...\r\n", godns.INTERVAL)
|
||||
time.Sleep(time.Minute * godns.INTERVAL)
|
||||
|
||||
@@ -50,11 +50,11 @@ func (handler *HEHandler) DomainLoop(domain *godns.Domain, panicChan chan<- godn
|
||||
log.Println("currentIP is:", currentIP)
|
||||
|
||||
//check against locally cached IP, if no change, skip update
|
||||
if (currentIP == lastIP){
|
||||
if currentIP == lastIP {
|
||||
log.Printf("IP is the same as cached one. Skip update.\n")
|
||||
} else {
|
||||
lastIP = currentIP
|
||||
|
||||
|
||||
for _, subDomain := range domain.SubDomains {
|
||||
log.Printf("%s.%s Start to update record IP...\n", subDomain, domain.DomainName)
|
||||
handler.UpdateIP(domain.DomainName, subDomain, currentIP)
|
||||
|
||||
Reference in New Issue
Block a user