From 87e9814e8587dee8b593b8b02f84cd359b365e5b Mon Sep 17 00:00:00 2001 From: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:41:18 +0800 Subject: Chore: refine reading MMDB file --- plugin/maxmind/mmdb_in.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'plugin/maxmind') diff --git a/plugin/maxmind/mmdb_in.go b/plugin/maxmind/mmdb_in.go index 80fa2523..0a539dd1 100644 --- a/plugin/maxmind/mmdb_in.go +++ b/plugin/maxmind/mmdb_in.go @@ -143,18 +143,7 @@ func (m *MaxmindMMDBIn) generateEntries(content []byte, entries map[string]*lib. networks := db.Networks(maxminddb.SkipAliasedNetworks) for networks.Next() { - record := struct { - Country struct { - IsoCode string `maxminddb:"iso_code"` - } `maxminddb:"country"` - RegisteredCountry struct { - IsoCode string `maxminddb:"iso_code"` - } `maxminddb:"registered_country"` - RepresentedCountry struct { - IsoCode string `maxminddb:"iso_code"` - } `maxminddb:"represented_country"` - }{} - + var record geoip2.Country subnet, err := networks.Network(&record) if err != nil { continue -- cgit v1.3.1