TimothyYe / godns

A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
https://timothyye.github.io/godns/
Apache License 2.0
1.5k stars 221 forks source link

GetCurrentIP error is shadowed during return #111

Closed razeencheng closed 3 years ago

razeencheng commented 3 years ago

These days I always accept the following email, where IP is empty.

image

Checked the logs and found that the program didn't get my IP address correctly.

[GoDNS] 2021/05/07 10:36:12 Cannot get IP...
[GoDNS] 2021/05/07 10:36:12 get ip online failed. Fallback to get ip from interface if possible.
[GoDNS] 2021/05/07 10:36:12 currentIP is:
[GoDNS] 2021/05/07 10:36:12 debug: 71446907 h
[GoDNS] 2021/05/07 10:36:12 h.razeen.cn Start to update record IP...
[GoDNS] 2021/05/07 10:36:12 Sending notification to:xxxxxx

But it doesn't have to email me.

So I reviewed the code and found that the error here was not returned correctly.