diff options
| author | Loyalsoldier <[email protected]> | 2024-11-03 08:41:18 +0800 |
|---|---|---|
| committer | Loyalsoldier <[email protected]> | 2024-11-03 08:41:18 +0800 |
| commit | 87e9814e8587dee8b593b8b02f84cd359b365e5b (patch) | |
| tree | 65ba469668a4e8c089f1609068578edb7a6050d9 /plugin | |
| parent | 5ddcf42db3b2633f73aa9fe7755174e4b0980814 (diff) | |
Chore: refine reading MMDB file
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/maxmind/mmdb_in.go | 13 |
1 files changed, 1 insertions, 12 deletions
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 |
