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).Lookupnow takes only the IP address and returns aResult.Lookup(ip, &rec)would now becomeLookup(ip).Decode(&rec).(*Reader).LookupNetworkhas been removed. To get the network for a result, use(Result).Prefix().(*Reader).LookupOffsetnow takes an offset and returns aResult.Resulthas anOffset()method that returns the offset value.(*Reader).Decodehas been removed.- Use of
net.IPand*net.IPNethave been replaced withnetip.Addrandnetip.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 calledcode, you might do something likeLookup(ip).DecodePath(&code, "country", "iso_code"). Strings should be used for map keys and ints for array indexes. (*Reader).Networksand(*Reader).NetworksWithinnow return a Go 1.23 iterator ofResultvalues. Aliased networks are now skipped by default. If you wish to include them, use theIncludeAliasedNetworksoption.