Skip to content

Releases: oschwald/maxminddb-golang

2.0.0-beta.10

24 Aug 02:48
3f8df2c
Compare
Choose a tag to compare
2.0.0-beta.10 Pre-release
Pre-release
  • Replaced runtime.SetFinalizer with runtime.AddCleanup for resource
    cleanup in Go 1.24+. This provides more reliable finalization behavior and
    better garbage collection performance.

2.0.0-beta.9

23 Aug 23:57
476083a
Compare
Choose a tag to compare
2.0.0-beta.9 Pre-release
Pre-release
  • SECURITY: Fixed integer overflow vulnerability in search tree size
    calculation that could potentially allow malformed databases to trigger
    security issues.
  • SECURITY: Enhanced bounds checking in tree traversal functions to return
    proper errors instead of silent failures when encountering malformed
    databases.
  • Added validation for invalid prefixes in NetworksWithin to prevent
    unexpected behavior with malformed input.
  • Added SkipEmptyValues() option for Networks and NetworksWithin to skip
    networks whose data is an empty map or empty array. This is useful for
    databases that store empty maps or arrays for records without meaningful
    data. GitHub #172.
  • Optimized custom unmarshaler type assertion to use Go 1.25's
    reflect.TypeAssert when available, reducing allocations in reflection code
    paths.
  • Improved memory mapping implementation by using SyscallConn() instead of
    Fd() to avoid side effects and prepare for Go 1.25+ Windows I/O
    enhancements. Pull request by database64128. GitHub #179.
  • Added OpenBytes function for better API discoverability and consistency
    with Open(). FromBytes is now deprecated and will be removed in a future
    version.

2.0.0-beta.8

15 Jul 22:28
31c2c6c
Compare
Choose a tag to compare
2.0.0-beta.8 Pre-release
Pre-release

2.0.0-beta.8

  • Fixed "no next offset available" error that occurred when using custom
    unmarshalers that decode container types (maps, slices) in struct fields.
    The reflection decoder now correctly calculates field positions when
    advancing to the next field after custom unmarshaling.

v2.0.0-beta.7

07 Jul 17:10
018782a
Compare
Choose a tag to compare
v2.0.0-beta.7 Pre-release
Pre-release

2.0.0-beta.7

  • Update capitalization of "uint" in ReadUInt* to match KindUint* as well
    as the Go standard library.

2.0.0-beta.6

07 Jul 17:04
8ea2bb6
Compare
Choose a tag to compare
2.0.0-beta.6 Pre-release
Pre-release

2.0.0-beta.6

  • Update capitalization of "uint" in ReadUInt* to match KindUint* as well
    as the Go standard library.

2.0.0-beta.5

06 Jul 20:20
ec9ebd2
Compare
Choose a tag to compare
2.0.0-beta.5 Pre-release
Pre-release

2.0.0-beta.5

  • Added Offset() method to Decoder to get the current database offset. This
    enables custom unmarshalers to implement caching for improved performance when
    loading databases with duplicate data structures.
  • Fixed infinite recursion in pointer-to-pointer data structures, which are
    invalid per the MaxMind DB specification.

2.0.0-beta-4

05 Jul 20:55
0719621
Compare
Choose a tag to compare
2.0.0-beta-4 Pre-release
Pre-release
  • BREAKING CHANGE: Removed experimental deserializer interface and
    supporting code. Applications using this interface should migrate to the
    Unmarshaler interface by implementing UnmarshalMaxMindDB(d *Decoder) error
    instead.
  • Open and FromBytes now accept options.
  • BREAKING CHANGE: IncludeNetworksWithoutData and IncludeAliasedNetworks
    now return a NetworksOption rather than being one themselves. These must now
    be called as functions: Networks(IncludeAliasedNetworks()) instead of
    Networks(IncludeAliasedNetworks). This was done to improve the documentation
    organization.
  • Added Unmarshaler interface to allow custom decoding implementations for
    performance-critical applications. Types implementing
    UnmarshalMaxMindDB(d *Decoder) error will automatically use custom decoding
    logic instead of reflection, following the same pattern as
    json.Unmarshaler.
  • Added public Decoder type and Kind constants in mmdbdata package for
    manual decoding. Decoder provides methods like ReadMap(), ReadSlice(),
    ReadString(), ReadUInt32(), PeekKind(), etc. Kind type includes
    helper methods String(), IsContainer(), and IsScalar() for type
    introspection. The main maxminddb package re-exports these types for
    backward compatibility. NewDecoder() supports an options pattern for
    future extensibility.
  • Enhanced UnmarshalMaxMindDB to work with nested struct fields, slice
    elements, and map values. The custom unmarshaler is now called recursively
    for any type that implements the Unmarshaler interface, similar to
    encoding/json.
  • Improved error messages to include byte offset information and, for the
    reflection-based API, path information for nested structures using JSON
    Pointer format. For example, errors may now show "at offset 1234, path
    /city/names/en" or "at offset 1234, path /list/0/name" instead of just the
    underlying error message.
  • PERFORMANCE: Added string interning optimization that reduces allocations
    while maintaining thread safety. Reduces allocation count from 33 to 10 per
    operation in downstream libraries. Uses a fixed 512-entry cache with per-entry
    mutexes for bounded memory usage (~8KB) while minimizing lock contention.

2.0.0-beta.3

16 Feb 02:22
8a6faa4
Compare
Choose a tag to compare
2.0.0-beta.3 Pre-release
Pre-release
  • Open will now fall back to loading the database in memory if the file-system does not support mmap. Pull request by database64128. GitHub #163.
  • Made significant improvements to the Windows memory-map handling. . GitHub #162.
  • Fix an integer overflow on large databases when using a 32-bit architecture. See ipinfo/mmdbctl#33.

2.0.0-beta.2

14 Nov 17:46
d591ef0
Compare
Choose a tag to compare
2.0.0-beta.2 Pre-release
Pre-release
  • Allow negative indexes for arrays when using DecodePath. #152
  • Add IncludeNetworksWithoutData option for Networks and NetworksWithin. #155 and #156

2.0.0-beta.1

18 Aug 23:47
b8ac5c0
Compare
Choose a tag to compare
2.0.0-beta.1 Pre-release
Pre-release

This is the first beta of the v2 releases. Go 1.23 is required. I don't expect to do a final release until Go 1.24 is available. See #141 for the v2 roadmap.

Notable changes:

  • (*Reader).Lookup now takes only the IP address and returns a Result. Lookup(ip, &rec) would now become Lookup(ip).Decode(&rec).
  • (*Reader).LookupNetwork has been removed. To get the network for a result, use (Result).Prefix().
  • (*Reader).LookupOffset now takes an offset and returns a Result. Result has an Offset() method that returns the offset value. (*Reader).Decode has been removed.
  • Use of net.IP and *net.IPNet have been replaced with netip.Addr and netip.Prefix.
  • You may now decode a particular path within a database record using (Result).DecodePath. For instance, to decode just the country code in GeoLite2 Country to a string called code, you might do something like Lookup(ip).DecodePath(&code, "country", "iso_code"). Strings should be used for map keys and ints for array indexes.
  • (*Reader).Networks and (*Reader).NetworksWithin now return a Go 1.23 iterator of Result values. Aliased networks are now skipped by default. If you wish to include them, use the IncludeAliasedNetworks option.