refactor(geoip,check-ip): inline literal mmdb filenames

Use 'GeoLite2-City.mmdb' / 'GeoLite2-ASN.mmdb' directly instead of
composing from the edition constants. Reads plainly — the actual
filename is right there.
This commit is contained in:
AJ ONeal 2026-04-20 16:13:30 -06:00
parent 359b740cec
commit cb39f30d91
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -134,8 +134,8 @@ func main() {
// downloaded via httpcache conditional GETs; otherwise the files are
// expected to exist on disk and are polled for out-of-band changes.
func geoFetcher(confPath, dir string) dataset.Fetcher {
cityPath := filepath.Join(dir, geoip.CityEdition+".mmdb")
asnPath := filepath.Join(dir, geoip.ASNEdition+".mmdb")
cityPath := filepath.Join(dir, "GeoLite2-City.mmdb")
asnPath := filepath.Join(dir, "GeoLite2-ASN.mmdb")
if confPath == "" {
for _, p := range geoip.DefaultConfPaths() {
if _, err := os.Stat(p); err == nil {

View File

@ -17,8 +17,8 @@ type Databases struct {
// Open opens <dir>/GeoLite2-City.mmdb and <dir>/GeoLite2-ASN.mmdb.
func Open(dir string) (*Databases, error) {
cityPath := filepath.Join(dir, CityEdition+".mmdb")
asnPath := filepath.Join(dir, ASNEdition+".mmdb")
cityPath := filepath.Join(dir, "GeoLite2-City.mmdb")
asnPath := filepath.Join(dir, "GeoLite2-ASN.mmdb")
city, err := geoip2.Open(cityPath)
if err != nil {
return nil, fmt.Errorf("open %s: %w", cityPath, err)