Skip to content

Conversation

@mm-ipinfo
Copy link
Contributor

@mm-ipinfo mm-ipinfo commented Jan 22, 2026

This upgrades to maxminddb-golang v2. See https://github.com/oschwald/maxminddb-golang/blob/main/MIGRATION.md for the differences.

This is mainly to make advantage of the new reader API to improve the export path in a subsequent PR (10x performance improvement on JSON export; #48).

$ go test ./...
?   	github.com/ipinfo/mmdbctl	[no test files]
ok  	github.com/ipinfo/mmdbctl/lib	(cached)

@mm-ipinfo mm-ipinfo requested a review from max-ipinfo January 22, 2026 20:31
}
}
}
if networksA.Err() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sure if you need similar handling still

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore, the error is now embedded in the result struct. If there is an error it will raise at decode time.

@max-ipinfo
Copy link
Contributor

The migration docs (https://github.com/oschwald/maxminddb-golang/blob/main/MIGRATION.md) mention:

Options such as SkipAliasedNetworks now use an options pattern. Pass them as Networks(SkipAliasedNetworks()) or NetworksWithin(prefix, SkipEmptyValues())

Copy link
Contributor Author

mm-ipinfo commented Jan 23, 2026

Sorry forgot to mention that. The option is now the default and has been replaced by the opposite IncludeAliasedNetworks option. So no need to pass it anymore. The doc is probably out of date 🙂

This was introduced in this commit: oschwald/maxminddb-golang@4a5a9d6

@mm-ipinfo mm-ipinfo merged commit b097961 into master Jan 23, 2026
@mm-ipinfo mm-ipinfo deleted the max/maxminddb-golang-v2 branch January 23, 2026 14:41
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.

3 participants