Skip to content

Releases: oschwald/geoip2-golang

2.0.0-beta.2

28 Jun 19:51
32fa95b
Compare
Choose a tag to compare
2.0.0-beta.2 Pre-release
Pre-release

2.0.0-beta.2

  • BREAKING CHANGE: Replaced IsZero() methods with HasData() methods on all
    result structs (including Names). The new methods provide clearer semantics:
    HasData() returns true when GeoIP data is found and false when no data is
    available. Unlike IsZero(), HasData() excludes Network and IPAddress fields
    from validation, allowing users to access network topology information even when
    no GeoIP data is found. The Network and IPAddress fields are now always
    populated for all lookups, regardless of whether GeoIP data is available.
  • BREAKING CHANGE: Replaced all anonymous nested structs with named types to
    improve struct initialization ergonomics. All result structs (Enterprise, City,
    Country) now use named types like EnterpriseCityRecord, CityTraits,
    CountryRecord, etc. This makes it much easier to initialize structs in user
    code while maintaining the same JSON serialization behavior.
  • BREAKING CHANGE: Changed Location.Latitude and Location.Longitude from
    float64 to *float64 to properly distinguish between missing coordinates and
    the valid location (0, 0). Missing coordinates are now represented as nil
    and are omitted from JSON output, while valid zero coordinates are preserved.
    This fixes the ambiguity where (0, 0) was incorrectly treated as "no data".
    Added Location.HasCoordinates() method for safe coordinate access. Reported
    by Nick Bruun. GitHub #5.

2.0.0-beta.1

22 Jun 21:30
d9bfea2
Compare
Choose a tag to compare
2.0.0-beta.1 Pre-release
Pre-release

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.

1.11.0

03 Jun 02:22
0972ffa
Compare
Choose a tag to compare
  • Go 1.21 or greater is now required.
  • The new is_anycast output is now supported on the GeoIP2 Country, City, and Enterprise databases. #119.

Note: 1.10.0 was accidentally skipped.

1.9.0

18 Jun 21:09
76f6c53
Compare
Choose a tag to compare
  • Rearrange fields in structs to reduce memory usage. Although this
    does reduce readability, these structs are often created at very
    rates, making the trade-off worth it.

1.8.0

07 Aug 19:29
482b789
Compare
Choose a tag to compare
  • Set Go version to 1.18 in go.mod.

1.7.0

26 Mar 17:41
d9e8a6a
Compare
Choose a tag to compare
  • Set the minimum Go version in the go.mod file to 1.17.
  • Updated dependencies.

1.6.1

28 Jan 01:23
Compare
Choose a tag to compare
  • This is a re-release with the changes that were supposed to be in 1.6.0.

1.6.0

28 Jan 01:21
f8b0583
Compare
Choose a tag to compare
  • Add support for new mobile_country_code and mobile_network_code outputs
    on GeoIP2 ISP and GeoIP2 Enterprise.

1.5.0

20 Feb 00:05
Compare
Choose a tag to compare
  • Add StaticIPScore field to Enterprise. Pull request by Pierre
    Bonzel. GitHub #54.
  • Add IsResidentialProxy field to AnonymousIP. Pull request by
    Brendan Boyle. GitHub #72.
  • Support DBIP-ASN-Lite database. Requested by Muhammad Hussein
    Fattahizadeh. GitHub #69.

1.4.0

25 Dec 00:47
Compare
Choose a tag to compare
  • This module now uses Go modules. Requested by Axel Etcheverry.
    GitHub #52.
  • DBIP databases are now supported. Requested by jaw0. GitHub #45.
  • Allow using the ASN method with the GeoIP2 ISP database. Pull request
    by lspgn. GitHub #47.
  • The example in the README.md now checks the length of the
    subdivision slice before using it. GitHub #51.