1
0
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:
TimothyYe
2018-12-07 16:04:59 +08:00
parent fb5c679bf7
commit 4c82260c4d
5 changed files with 47 additions and 40 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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)