From f41d1ca4a0b148aeec26673b11625703cae1c13a Mon Sep 17 00:00:00 2001 From: Akkia Date: Tue, 5 Jul 2022 20:08:57 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9C=AA=E8=8E=B7=E5=8F=96=E5=88=B0c?= =?UTF-8?q?ountry=20code=E6=97=B6=E7=BB=A7=E7=BB=AD=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E4=B8=AAAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/agent/monitor/myip.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/agent/monitor/myip.go b/cmd/agent/monitor/myip.go index 055e36a..c33675d 100644 --- a/cmd/agent/monitor/myip.go +++ b/cmd/agent/monitor/myip.go @@ -102,6 +102,10 @@ func fetchGeoIP(servers []string, isV6 bool) geoIP { if !isV6 && !strings.Contains(ip.IP, ".") { continue } + // 未获取到国家码 + if ip.CountryCode == "" { + continue + } return ip } }