Skip to content

Commit 41d89ba

Browse files
committed
Add omitzero for JSON tags
1 parent 619ccfd commit 41d89ba

File tree

5 files changed

+156
-151
lines changed

5 files changed

+156
-151
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Build
99
strategy:
1010
matrix:
11-
go-version: [1.23.x, 1.24.x]
11+
go-version: [1.24.x]
1212
platform: [ubuntu-latest, macos-latest, windows-latest]
1313
runs-on: ${{ matrix.platform }}
1414
steps:

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: "2"
22
run:
3-
go: "1.23"
3+
go: "1.24"
44
tests: true
55
allow-parallel-runners: true
66
linters:
@@ -23,6 +23,8 @@ linters:
2323
- nlreturn
2424
- nonamedreturns
2525
- paralleltest
26+
# Seems to conflict with golines or one of the formatters.
27+
- tagalign
2628
- testpackage
2729
- thelper
2830
- varnamelen

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* **BREAKING CHANGE**: Removed `IsAnonymousProxy` and `IsSatelliteProvider` fields
1717
from all Traits structs. These fields have been removed from MaxMind databases.
1818
Use the dedicated Anonymous IP database for anonymity detection instead.
19+
* **BREAKING CHANGE**: Go 1.24 or greater is now required. This enables the use
20+
of `omitzero` in JSON tags to match MaxMind database behavior where empty
21+
values are not included.
1922
* Added `IsZero()` method to all result structs (City, Country, Enterprise, ASN,
2023
etc.) to easily check whether any data was found for the queried IP address.
2124
Requested by Salim Alami. GitHub [#32](https://github.com/oschwald/geoip2-golang/issues/32).

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/oschwald/geoip2-golang/v2
22

3-
go 1.23.0
3+
go 1.24
44

55
require (
66
github.com/quasilyte/go-ruleguard/dsl v0.3.22

0 commit comments

Comments
 (0)