Skip to content

Conversation

elfranne
Copy link

@oschwald
Copy link
Owner

The ASN data is structured differently than MaxMind databases and will not work. Although the country iso_code value should work, you would be better off using maxminddb/v2:

db, err := maxminddb.Open("latest.mmdb")
if err != nil {
	return err
}

var countryCode string
err = db.Lookup(ip).DecodePath(&countryCode, "country", "iso_code")
if err != nil {
	return err
}

@elfranne
Copy link
Author

Can we just add the Country one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants