diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-11-20 04:42:06 -0500 |
---|---|---|
committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-11-20 06:12:13 -0500 |
commit | d6f3af5733de6806983fd5194521b498eeb6f692 (patch) | |
tree | 604ea227ed2badf6bb01513a6e222d561fe54580 /pkg/regionmap | |
parent | d02c7b58e7c25c548de413b74592b82fc30322a3 (diff) | |
download | Atlas-d6f3af5733de6806983fd5194521b498eeb6f692.tar.gz Atlas-d6f3af5733de6806983fd5194521b498eeb6f692.zip |
pkg/regionmap: Add explicit mapping for Taiwan
It isn't in the UN M.49 mapping.
Diffstat (limited to 'pkg/regionmap')
-rw-r--r-- | pkg/regionmap/region.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/regionmap/region.go b/pkg/regionmap/region.go index a72196d..de2e13f 100644 --- a/pkg/regionmap/region.go +++ b/pkg/regionmap/region.go @@ -102,6 +102,11 @@ func GetRegion(ip netip.Addr, r ip2location.Record) (string, error) { return "Antartica", nil } + // for Taiwan, use "Asia East" (it isn't in the UN M.49 mapping) + if r.CountryShort == "TW" { + return "Asia East", nil + } + // the rest are based on the M.49 mapping m49region, m49subRegion, _, ok := m49(r.CountryShort) if !ok { |