From 374c2b74ad18289e44870ab9f98c9130ee5d215c Mon Sep 17 00:00:00 2001 From: Shizun Ge Date: Sat, 11 Feb 2023 01:06:16 -0800 Subject: [PATCH] report unknow location for local ip --- geoip.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/geoip.go b/geoip.go index 469a54f..3e69117 100644 --- a/geoip.go +++ b/geoip.go @@ -133,8 +133,10 @@ func geohashAndLocationFromMaxMindDb(address string) (string, string, string, er latitude = loc.Latitude longitude = loc.Longitude } else { - // For debugging, adding the iso to the country name. - countryName = countryName + " (" + iso + ")" + if iso != "" { + // For debugging, adding the iso to the country name. + countryName = countryName + " (" + iso + ")" + } } } gh := geohash.EncodeAuto(latitude, longitude)