From 99701deb17a167a443a2f67b020ce4732ac5b486 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Wed, 23 Jul 2025 14:22:53 -0600 Subject: [PATCH 1/3] Fix current `gofmt` errors --- ipinfo/doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipinfo/doc.go b/ipinfo/doc.go index f973863..689c33a 100644 --- a/ipinfo/doc.go +++ b/ipinfo/doc.go @@ -10,7 +10,7 @@ For example: info, err := ipinfo.GetIPInfo(net.ParseIP("8.8.8.8")) -Authorization +# Authorization To perform authorized API calls with more data and higher limits, pass in a non-empty token to NewClient. For example: From 4fb6aa1dcf3ad68d7af5567c5434065c5bea03b3 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Wed, 23 Jul 2025 14:24:25 -0600 Subject: [PATCH 2/3] Github Actions workflow to check building and formatting --- .github/workflows/ci.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9c135f2 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,36 @@ +name: Run tests + +on: + pull_request: + branches: [master] + push: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + go: ["1.18", "1.19", "1.20", "1.21", "1.22", "1.23", "1.24"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + + - name: Build + run: go build -v ./... + + - name: gofmt + run: | + unformatted_files=$(gofmt -l .) + if [ -n "$unformatted_files" ]; then + echo "The following files are not Go formatted:" + echo "$unformatted_files" + echo "Please run 'gofmt -w .' to fix them." + exit 1 + fi + echo "All Go files are well formatted." From bc7e388dd6205d3a4d06831ffa8095c74045cc90 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Wed, 23 Jul 2025 14:29:05 -0600 Subject: [PATCH 3/3] Upgrade minimal version to 1.18 to reflect use of `net/netip` --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 948aa5c..238a50f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ipinfo/go/v2 -go 1.15 +go 1.18 require ( github.com/patrickmn/go-cache v2.1.0+incompatible