From dff1e29c40c282f0392aee2ce7c6b9398fad61b3 Mon Sep 17 00:00:00 2001 From: naiba Date: Tue, 13 Jul 2021 11:09:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A9=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/agent/monitor/myip.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/agent/monitor/myip.go b/cmd/agent/monitor/myip.go index 17b09a4..a0a2449 100644 --- a/cmd/agent/monitor/myip.go +++ b/cmd/agent/monitor/myip.go @@ -65,6 +65,9 @@ func fetchGeoIP(servers []string, isV6 bool) geoIP { if err != nil { continue } + if ip.IP == "" && ip.Query != "" { + ip.IP = ip.Query + } // 没取到 v6 IP if isV6 && !strings.Contains(ip.IP, ":") { continue @@ -73,9 +76,6 @@ func fetchGeoIP(servers []string, isV6 bool) geoIP { if !isV6 && !strings.Contains(ip.IP, ".") { continue } - if ip.IP == "" && ip.Query != "" { - ip.IP = ip.Query - } return ip } }