github oschwald/geoip2-golang v2.0.0-beta.1
2.0.0-beta.1

latest releases: v2.0.0-beta.4, v1.13.0, v2.0.0-beta.3...
pre-release2 months ago

2.0.0-beta.1

  • BREAKING CHANGE: Updated to use maxminddb-golang/v2 which provides
    significant performance improvements and a more modern API.
  • BREAKING CHANGE: All lookup methods now accept netip.Addr instead of
    net.IP. This provides better performance and aligns with modern Go
    networking practices.
  • BREAKING CHANGE: Renamed IsoCode fields to ISOCode in all structs
    to follow proper capitalization for the ISO acronym. Closes GitHub issue #4.
  • BREAKING CHANGE: Replaced map[string]string Names fields with structured
    Names type for significant performance improvements. This eliminates map
    allocation overhead, reducing memory usage by 34% and allocations by 56%.
  • BREAKING CHANGE: Added JSON tags to all struct fields. JSON tags match
    the corresponding maxminddb tags where they exist. Custom fields (IPAddress
    and Network) use snake_case (ip_address and network).
  • BREAKING CHANGE: Removed IsAnonymousProxy and IsSatelliteProvider fields
    from all Traits structs. These fields have been removed from MaxMind databases.
    Use the dedicated Anonymous IP database for anonymity detection instead.
  • BREAKING CHANGE: Go 1.24 or greater is now required. This enables the use
    of omitzero in JSON tags to match MaxMind database behavior where empty
    values are not included.
  • Added IsZero() method to all result structs (City, Country, Enterprise, ASN,
    etc.) to easily check whether any data was found for the queried IP address.
    Requested by Salim Alami. GitHub #32.
  • Added Network and IPAddress fields to all result structs. The Network field
    exposes the network prefix from the MaxMind database lookup, and the IPAddress field
    contains the IP address used during the lookup. These fields are only populated when
    data is found for the IP address. For flat record types (ASN, ConnectionType, Domain,
    ISP, AnonymousIP), the fields are named Network and IPAddress. For complex types
    (City, Country, Enterprise), the fields are located at .Traits.Network and
    .Traits.IPAddress.
    Requested by Aaron Bishop. GitHub #128.
  • Updated module path to github.com/oschwald/geoip2-golang/v2 to follow
    Go's semantic versioning guidelines for breaking changes.
  • Updated examples and documentation to demonstrate proper error handling
    with netip.ParseAddr().
  • Updated linting rules to support both v1 and v2 import paths during the
    transition period.

Don't miss a new geoip2-golang release

NewReleases is sending notifications on new releases.