11# 2.0.0 -
22
3- * Updated dependency on ` github.com/oschwald/maxminddb-golang/v2 ` to ` v2.0.0 ` .
3+ - Updated dependency on ` github.com/oschwald/maxminddb-golang/v2 ` to ` v2.0.0 ` .
44
55# 2.0.0-beta.4 - 2025-08-23
66
7- * Updated maxminddb dependency to v2.0.0-beta.9.
8- * Added ` OpenBytes ` method to match the API changes in maxminddb v2.0.0-beta.9.
9- * Deprecated ` FromBytes ` method. Use ` OpenBytes ` instead. ` FromBytes ` will be
7+ - Updated maxminddb dependency to v2.0.0-beta.9.
8+ - Added ` OpenBytes ` method to match the API changes in maxminddb v2.0.0-beta.9.
9+ - Deprecated ` FromBytes ` method. Use ` OpenBytes ` instead. ` FromBytes ` will be
1010 removed in a future version.
1111
1212# 2.0.0-beta.3 - 2025-07-07
1313
14- * Add support for ` GeoIP-City-Redacted-US ` and ` GeoIP-Enterprise-Redacted-US ` .
14+ - Add support for ` GeoIP-City-Redacted-US ` and ` GeoIP-Enterprise-Redacted-US ` .
1515 Requested by Tom Anderson. GitHub #134 .
16- * Upgrade ` github.com/oschwald/maxminddb-golang/v2 ` to ` v2.0.0-beta.7 ` .
16+ - Upgrade ` github.com/oschwald/maxminddb-golang/v2 ` to ` v2.0.0-beta.7 ` .
1717
1818# 2.0.0-beta.2 - 2025-06-28
1919
20- * ** BREAKING CHANGE** : Replaced ` IsZero() ` methods with ` HasData() ` methods on all
21- result structs (including Names). The new methods provide clearer semantics:
22- ` HasData() ` returns ` true ` when GeoIP data is found and ` false ` when no data is
23- available. Unlike ` IsZero() ` , ` HasData() ` excludes Network and IPAddress fields
24- from validation, allowing users to access network topology information even when
25- no GeoIP data is found. The Network and IPAddress fields are now always
26- populated for all lookups, regardless of whether GeoIP data is available.
27- * ** BREAKING CHANGE** : Replaced all anonymous nested structs with named types to
28- improve struct initialization ergonomics. All result structs (Enterprise, City,
29- Country) now use named types like ` EnterpriseCityRecord ` , ` CityTraits ` ,
20+ - ** BREAKING CHANGE** : Replaced ` IsZero() ` methods with ` HasData() ` methods on
21+ all result structs (including Names). The new methods provide clearer
22+ semantics: ` HasData() ` returns ` true ` when GeoIP data is found and ` false `
23+ when no data is available. Unlike ` IsZero() ` , ` HasData() ` excludes Network
24+ and IPAddress fields from validation, allowing users to access network
25+ topology information even when no GeoIP data is found. The Network and
26+ IPAddress fields are now always populated for all lookups, regardless of
27+ whether GeoIP data is available.
28+ - ** BREAKING CHANGE** : Replaced all anonymous nested structs with named types
29+ to improve struct initialization ergonomics. All result structs (Enterprise,
30+ City, Country) now use named types like ` EnterpriseCityRecord ` , ` CityTraits ` ,
3031 ` CountryRecord ` , etc. This makes it much easier to initialize structs in user
3132 code while maintaining the same JSON serialization behavior.
32- * ** BREAKING CHANGE** : Changed ` Location.Latitude ` and ` Location.Longitude ` from
33- ` float64 ` to ` *float64 ` to properly distinguish between missing coordinates and
34- the valid location (0, 0). Missing coordinates are now represented as ` nil `
35- and are omitted from JSON output, while valid zero coordinates are preserved.
36- This fixes the ambiguity where (0, 0) was incorrectly treated as "no data".
37- Added ` Location.HasCoordinates() ` method for safe coordinate access. Reported
38- by Nick Bruun. GitHub #5 .
33+ - ** BREAKING CHANGE** : Changed ` Location.Latitude ` and ` Location.Longitude `
34+ from ` float64 ` to ` *float64 ` to properly distinguish between missing
35+ coordinates and the valid location (0, 0). Missing coordinates are now
36+ represented as ` nil ` and are omitted from JSON output, while valid zero
37+ coordinates are preserved. This fixes the ambiguity where (0, 0) was
38+ incorrectly treated as "no data". Added ` Location.HasCoordinates() ` method
39+ for safe coordinate access. Reported by Nick Bruun. GitHub #5 .
3940
4041# 2.0.0-beta.1 - 2025-06-22
4142
42- * ** BREAKING CHANGE** : Updated to use ` maxminddb-golang/v2 ` which provides
43+ - ** BREAKING CHANGE** : Updated to use ` maxminddb-golang/v2 ` which provides
4344 significant performance improvements and a more modern API.
44- * ** BREAKING CHANGE** : All lookup methods now accept ` netip.Addr ` instead of
45+ - ** BREAKING CHANGE** : All lookup methods now accept ` netip.Addr ` instead of
4546 ` net.IP ` . This provides better performance and aligns with modern Go
4647 networking practices.
47- * ** BREAKING CHANGE** : Renamed ` IsoCode ` fields to ` ISOCode ` in all structs
48- to follow proper capitalization for the ISO acronym. Closes GitHub issue #4 .
49- * ** BREAKING CHANGE** : Replaced ` map[string]string ` Names fields with structured
50- ` Names ` type for significant performance improvements. This eliminates map
51- allocation overhead, reducing memory usage by 34% and allocations by 56%.
52- * ** BREAKING CHANGE** : Added JSON tags to all struct fields. JSON tags match
53- the corresponding ` maxminddb ` tags where they exist. Custom fields (` IPAddress `
54- and ` Network ` ) use snake_case (` ip_address ` and ` network ` ).
55- * ** BREAKING CHANGE** : Removed ` IsAnonymousProxy ` and ` IsSatelliteProvider ` fields
56- from all Traits structs. These fields have been removed from MaxMind databases.
57- Use the dedicated Anonymous IP database for anonymity detection instead.
58- * ** BREAKING CHANGE** : Go 1.24 or greater is now required. This enables the use
48+ - ** BREAKING CHANGE** : Renamed ` IsoCode ` fields to ` ISOCode ` in all structs to
49+ follow proper capitalization for the ISO acronym. Closes GitHub issue #4 .
50+ - ** BREAKING CHANGE** : Replaced ` map[string]string ` Names fields with
51+ structured ` Names ` type for significant performance improvements. This
52+ eliminates map allocation overhead, reducing memory usage by 34% and
53+ allocations by 56%.
54+ - ** BREAKING CHANGE** : Added JSON tags to all struct fields. JSON tags match
55+ the corresponding ` maxminddb ` tags where they exist. Custom fields
56+ (` IPAddress ` and ` Network ` ) use snake_case (` ip_address ` and ` network ` ).
57+ - ** BREAKING CHANGE** : Removed ` IsAnonymousProxy ` and ` IsSatelliteProvider `
58+ fields from all Traits structs. These fields have been removed from MaxMind
59+ databases. Use the dedicated Anonymous IP database for anonymity detection
60+ instead.
61+ - ** BREAKING CHANGE** : Go 1.24 or greater is now required. This enables the use
5962 of ` omitzero ` in JSON tags to match MaxMind database behavior where empty
6063 values are not included.
61- * Added ` IsZero() ` method to all result structs (City, Country, Enterprise, ASN,
62- etc.) to easily check whether any data was found for the queried IP address.
63- Requested by Salim Alami. GitHub [ #32 ] ( https://github.com/oschwald/geoip2-golang/issues/32 ) .
64- * Added ` Network ` and ` IPAddress ` fields to all result structs. The ` Network ` field
65- exposes the network prefix from the MaxMind database lookup, and the ` IPAddress ` field
66- contains the IP address used during the lookup. These fields are only populated when
67- data is found for the IP address. For flat record types (ASN, ConnectionType, Domain,
68- ISP, AnonymousIP), the fields are named ` Network ` and ` IPAddress ` . For complex types
69- (City, Country, Enterprise), the fields are located at ` .Traits.Network ` and
70- ` .Traits.IPAddress ` .
71- Requested by Aaron Bishop. GitHub [ #128 ] ( https://github.com/oschwald/geoip2-golang/issues/128 ) .
72- * Updated module path to ` github.com/oschwald/geoip2-golang/v2 ` to follow
73- Go's semantic versioning guidelines for breaking changes.
74- * Updated examples and documentation to demonstrate proper error handling
75- with ` netip.ParseAddr() ` .
76- * Updated linting rules to support both v1 and v2 import paths during the
64+ - Added ` IsZero() ` method to all result structs (City, Country, Enterprise,
65+ ASN, etc.) to easily check whether any data was found for the queried IP
66+ address. Requested by Salim Alami. GitHub
67+ [ #32 ] ( https://github.com/oschwald/geoip2-golang/issues/32 ) .
68+ - Added ` Network ` and ` IPAddress ` fields to all result structs. The ` Network `
69+ field exposes the network prefix from the MaxMind database lookup, and the
70+ ` IPAddress ` field contains the IP address used during the lookup. These
71+ fields are only populated when data is found for the IP address. For flat
72+ record types (ASN, ConnectionType, Domain, ISP, AnonymousIP), the fields are
73+ named ` Network ` and ` IPAddress ` . For complex types (City, Country,
74+ Enterprise), the fields are located at ` .Traits.Network ` and
75+ ` .Traits.IPAddress ` . Requested by Aaron Bishop. GitHub
76+ [ #128 ] ( https://github.com/oschwald/geoip2-golang/issues/128 ) .
77+ - Updated module path to ` github.com/oschwald/geoip2-golang/v2 ` to follow Go's
78+ semantic versioning guidelines for breaking changes.
79+ - Updated examples and documentation to demonstrate proper error handling with
80+ ` netip.ParseAddr() ` .
81+ - Updated linting rules to support both v1 and v2 import paths during the
7782 transition period.
7883
7984## Migration Guide
8085
8186To migrate from v1 to v2:
8287
83881 . Update your import path:
89+
8490 ``` go
8591 // Old
8692 import " github.com/oschwald/geoip2-golang"
@@ -90,6 +96,7 @@ To migrate from v1 to v2:
9096 ```
9197
92982 . Replace ` net.IP ` with ` netip.Addr ` :
99+
93100 ``` go
94101 // Old
95102 ip := net.ParseIP (" 81.2.69.142" )
@@ -104,6 +111,7 @@ To migrate from v1 to v2:
104111 ```
105112
1061133 . Update field names from ` IsoCode ` to ` ISOCode ` :
114+
107115 ``` go
108116 // Old
109117 countryCode := record.Country .IsoCode
@@ -115,6 +123,7 @@ To migrate from v1 to v2:
115123 ```
116124
1171254 . Replace map-based Names access with struct fields:
126+
118127 ``` go
119128 // Old
120129 cityName := record.City .Names [" en" ]
@@ -152,78 +161,82 @@ To migrate from v1 to v2:
152161
153162# 1.11.0 - 2024-06-03
154163
155- * Go 1.21 or greater is now required.
156- * The new ` is_anycast ` output is now supported on the GeoIP2 Country, City,
157- and Enterprise databases. [ #119 ] ( https://github.com/oschwald/geoip2-golang/issues/119 ) .
164+ - Go 1.21 or greater is now required.
165+ - The new ` is_anycast ` output is now supported on the GeoIP2 Country, City, and
166+ Enterprise databases.
167+ [ #119 ] ( https://github.com/oschwald/geoip2-golang/issues/119 ) .
158168
159169Note: 1.10.0 was accidentally skipped.
160170
161171# 1.9.0 - 2023-06-18
162172
163- * Rearrange fields in structs to reduce memory usage. Although this
164- does reduce readability, these structs are often created at very
165- rates, making the trade-off worth it.
173+ - Rearrange fields in structs to reduce memory usage. Although this does reduce
174+ readability, these structs are often created at very rates, making the
175+ trade-off worth it.
166176
167177# 1.8.0 - 2022-08-07
168178
169- * Set Go version to 1.18 in go.mod.
179+ - Set Go version to 1.18 in go.mod.
170180
171181# 1.7.0 - 2022-03-26
172182
173- * Set the minimum Go version in the go.mod file to 1.17.
174- * Updated dependencies.
183+ - Set the minimum Go version in the go.mod file to 1.17.
184+ - Updated dependencies.
175185
176186# 1.6.1 - 2022-01-28
177187
178- * This is a re-release with the changes that were supposed to be in 1.6.0.
188+ - This is a re-release with the changes that were supposed to be in 1.6.0.
179189
180190# 1.6.0 - 2022-01-28
181191
182- * Add support for new ` mobile_country_code ` and ` mobile_network_code ` outputs
192+ - Add support for new ` mobile_country_code ` and ` mobile_network_code ` outputs
183193 on GeoIP2 ISP and GeoIP2 Enterprise.
184194
185195# 1.5.0 - 2021-02-20
186196
187- * Add ` StaticIPScore ` field to Enterprise. Pull request by Pierre
188- Bonzel. GitHub [ #54 ] ( https://github.com/oschwald/geoip2-golang/issues/54 ) .
189- * Add ` IsResidentialProxy ` field to ` AnonymousIP ` . Pull request by
190- Brendan Boyle. GitHub [ #72 ] ( https://github.com/oschwald/geoip2-golang/issues/72 ) .
191- * Support DBIP-ASN-Lite database. Requested by Muhammad Hussein
192- Fattahizadeh. GitHub [ #69 ] ( https://github.com/oschwald/geoip2-golang/issues/69 ) .
197+ - Add ` StaticIPScore ` field to Enterprise. Pull request by Pierre Bonzel.
198+ GitHub [ #54 ] ( https://github.com/oschwald/geoip2-golang/issues/54 ) .
199+ - Add ` IsResidentialProxy ` field to ` AnonymousIP ` . Pull request by Brendan
200+ Boyle. GitHub [ #72 ] ( https://github.com/oschwald/geoip2-golang/issues/72 ) .
201+ - Support DBIP-ASN-Lite database. Requested by Muhammad Hussein Fattahizadeh.
202+ GitHub [ #69 ] ( https://github.com/oschwald/geoip2-golang/issues/69 ) .
193203
194204# 1.4.0 - 2019-12-25
195205
196- * This module now uses Go modules. Requested by Axel Etcheverry.
197- GitHub [ #52 ] ( https://github.com/oschwald/geoip2-golang/issues/52 ) .
198- * DBIP databases are now supported. Requested by jaw0. GitHub [ #45 ] ( https://github.com/oschwald/geoip2-golang/issues/45 ) .
199- * Allow using the ASN method with the GeoIP2 ISP database. Pull request
200- by lspgn. GitHub [ #47 ] ( https://github.com/oschwald/geoip2-golang/issues/47 ) .
201- * The example in the ` README.md ` now checks the length of the
202- subdivision slice before using it. GitHub [ #51 ] ( https://github.com/oschwald/geoip2-golang/issues/51 ) .
206+ - This module now uses Go modules. Requested by Axel Etcheverry. GitHub
207+ [ #52 ] ( https://github.com/oschwald/geoip2-golang/issues/52 ) .
208+ - DBIP databases are now supported. Requested by jaw0. GitHub
209+ [ #45 ] ( https://github.com/oschwald/geoip2-golang/issues/45 ) .
210+ - Allow using the ASN method with the GeoIP2 ISP database. Pull request by
211+ lspgn. GitHub [ #47 ] ( https://github.com/oschwald/geoip2-golang/issues/47 ) .
212+ - The example in the ` README.md ` now checks the length of the subdivision slice
213+ before using it. GitHub
214+ [ #51 ] ( https://github.com/oschwald/geoip2-golang/issues/51 ) .
203215
204216# 1.3.0 - 2019-08-28
205217
206- * Added support for the GeoIP2 Enterprise database.
218+ - Added support for the GeoIP2 Enterprise database.
207219
208220# 1.2.1 - 2018-02-25
209221
210- * HTTPS is now used for the test data submodule rather than the Git
211- protocol
222+ - HTTPS is now used for the test data submodule rather than the Git protocol
212223
213224# 1.2.0 - 2018-02-19
214225
215- * The country structs for ` geoip2.City ` and ` geoip2.Country ` now have an
216- ` IsInEuropeanUnion ` boolean field. This is true when the associated
217- country is a member state of the European Union. This requires a
218- database built on or after February 13, 2018.
219- * Switch from Go Check to Testify. Closes [ #27 ] ( https://github.com/oschwald/geoip2-golang/issues/27 )
226+ - The country structs for ` geoip2.City ` and ` geoip2.Country ` now have an
227+ ` IsInEuropeanUnion ` boolean field. This is true when the associated country
228+ is a member state of the European Union. This requires a database built on or
229+ after February 13, 2018.
230+ - Switch from Go Check to Testify. Closes
231+ [ #27 ] ( https://github.com/oschwald/geoip2-golang/issues/27 )
220232
221233# 1.1.0 - 2017-04-23
222234
223- * Add support for the GeoLite2 ASN database.
224- * Add support for the GeoIP2 City by Continent databases. GitHub [ # 26 ] ( https://github.com/oschwald/geoip2-golang/issues/26 ) .
225-
235+ - Add support for the GeoLite2 ASN database.
236+ - Add support for the GeoIP2 City by Continent databases. GitHub
237+ [ # 26 ] ( https://github.com/oschwald/geoip2-golang/issues/26 ) .
226238
227239# 1.0.0 - 2016-11-09
228240
229- New release for those using tagged releases. Closes [ #21 ] ( https://github.com/oschwald/geoip2-golang/issues/21 ) .
241+ New release for those using tagged releases. Closes
242+ [ #21 ] ( https://github.com/oschwald/geoip2-golang/issues/21 ) .
0 commit comments