Skip to content

Commit 863c6ea

Browse files
mromaszewiczclaude
andauthored
Update all dependencies to Go 1.24 (#2264)
* chore: require go 1.24 as minimum version across all modules Bump all go.mod files from go 1.22.5 to go 1.24 and normalize any go 1.24.0 to go 1.24 for consistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove inner go.mod files that existed only for go 1.24 requirement Now that all modules require go 1.24, these inner modules are no longer needed as separate modules. Their packages are absorbed by the parent modules (internal/test and examples), which now include the fiber dependencies directly. Removed inner modules: - internal/test/strict-server/fiber/ - internal/test/issues/issue1469/ - internal/test/issues/issue-1529/strict-fiber/ - examples/minimal-server/stdhttp-go-tool/ - examples/minimal-server/fiber/ - examples/extensions/xomitzero/ - examples/petstore-expanded/fiber/ - examples/output-options/preferskipoptionalpointerwithomitzero/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: update dependencies to latest go 1.24-compatible versions Run go get for all direct dependencies across all modules, constrained to go 1.24 via GOTOOLCHAIN=go1.24.4 to avoid pulling in deps that require go 1.25. Notable updates: - gin v1.10.1 -> v1.11.0 (v1.12.0 requires go 1.25) - iris v12.2.6 -> v12.2.11 - echo v4.11.4/v4.12.0 -> v4.15.1 - chi v5.0.10 -> v5.2.5 - golang.org/x/tools v0.30.0 -> v0.42.0 - golang.org/x/mod v0.23.0 -> v0.33.0 - golang.org/x/text v0.20.0 -> v0.34.0 Pinned speakeasy-api/jsonpath at v0.6.0 across all modules due to v0.6.1+ removing the pkg/overlay package that openapi-overlay tests depend on. Pinned dprotaso/go-yit at the pre-yaml/v4 version as the newer version switches to go.yaml.in/yaml/v4 which is incompatible with vmware-labs/yaml-jsonpath. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * update readme * ci: skip Go 1.22 and 1.23 in CI matrix Now that all modules require go 1.24, exclude older versions from the CI build/test/tidy/generate matrix via the excluding_versions input on the reusable workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove Go version guards from child module Makefiles Now that go 1.24 is the minimum version, the execute-if-go-122/124 guards are always true. Simplify the Makefiles to run commands directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: update deprecated code Remove usage of deprecated middleware.Logger() from Echo examples and tests. This was deprecated in Echo v4.15.1 in favor of middleware.RequestLogger or middleware.RequestLoggerWithConfig. Since these calls only added request logging for debugging convenience, they are removed rather than replaced. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c966b37 commit 863c6ea

File tree

49 files changed

+632
-2943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+632
-2943
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
build:
1010
uses: oapi-codegen/actions/.github/workflows/ci.yml@75566d848d25021f137594c947f26171094fb511 # v0.5.0
1111
with:
12+
excluding_versions: '["1.22", "1.23"]'
1213
lint_versions: '["1.25"]'
1314

1415
build-binaries:

README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
4242

4343
## Install
4444

45-
### For Go 1.24+
46-
4745
It is recommended to follow [the `go tool` support available from Go 1.24+](https://www.jvt.me/posts/2025/01/27/go-tools-124/) for managing the dependency of `oapi-codegen` alongside your core application.
4846

4947
To do this, you run `go get -tool`:
@@ -59,29 +57,6 @@ From there, each invocation of `oapi-codegen` would be used like so:
5957
//go:generate go tool oapi-codegen -config cfg.yaml ../../api.yaml
6058
```
6159

62-
### Prior to Go 1.24
63-
64-
It is recommended to follow [the `tools.go` pattern](https://www.jvt.me/posts/2022/06/15/go-tools-dependency-management/) for managing the dependency of `oapi-codegen` alongside your core application.
65-
66-
This would give you a `tools/tools.go`:
67-
68-
```go
69-
//go:build tools
70-
// +build tools
71-
72-
package main
73-
74-
import (
75-
_ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen"
76-
)
77-
```
78-
79-
Then, each invocation of `oapi-codegen` would be used like so:
80-
81-
```go
82-
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../../api.yaml
83-
```
84-
8560
Alternatively, you can install it as a binary with:
8661

8762
```sh

examples/authenticated-api/echo/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"net"
77

88
"github.com/labstack/echo/v4"
9-
"github.com/labstack/echo/v4/middleware"
109
"github.com/oapi-codegen/oapi-codegen/v2/examples/authenticated-api/echo/api"
1110
"github.com/oapi-codegen/oapi-codegen/v2/examples/authenticated-api/echo/server"
1211
)
@@ -28,7 +27,6 @@ func main() {
2827
if err != nil {
2928
log.Fatalln("error creating middleware:", err)
3029
}
31-
e.Use(middleware.Logger())
3230
e.Use(mw...)
3331

3432
svr := server.NewServer()
Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
1-
SHELL:=/bin/bash
2-
3-
YELLOW := \e[0;33m
4-
RESET := \e[0;0m
5-
6-
GOVER := $(shell go env GOVERSION)
7-
GOMINOR := $(shell bash -c "cut -f1 -d' ' <<< \"$(GOVER)\" | cut -f2 -d.")
8-
9-
define execute-if-go-122
10-
@{ \
11-
if [[ 22 -le $(GOMINOR) ]]; then \
12-
$1; \
13-
else \
14-
echo -e "$(YELLOW)Skipping task as you're running Go v1.$(GOMINOR).x which is < Go 1.22, which this module requires$(RESET)"; \
15-
fi \
16-
}
17-
endef
18-
191
lint:
20-
$(call execute-if-go-122,$(GOBIN)/golangci-lint run ./...)
2+
$(GOBIN)/golangci-lint run ./...
213

224
lint-ci:
23-
24-
$(call execute-if-go-122,$(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m)
5+
$(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m
256

267
generate:
27-
$(call execute-if-go-122,go generate ./...)
8+
go generate ./...
289

2910
test:
30-
$(call execute-if-go-122,go test -cover ./...)
11+
go test -cover ./...
3112

3213
tidy:
33-
$(call execute-if-go-122,go mod tidy)
14+
go mod tidy
3415

3516
tidy-ci:
36-
$(call execute-if-go-122,tidied -verbose)
17+
tidied -verbose
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
module github.com/oapi-codegen/oapi-codegen/v2/examples/authenticated-api/stdhttp
22

3-
go 1.22.5
3+
go 1.24.3
44

55
replace github.com/oapi-codegen/oapi-codegen/v2 => ../../../
66

77
require (
88
github.com/getkin/kin-openapi v0.133.0
9-
github.com/lestrrat-go/jwx v1.2.29
10-
github.com/oapi-codegen/nethttp-middleware v1.0.2
9+
github.com/lestrrat-go/jwx v1.2.31
10+
github.com/oapi-codegen/nethttp-middleware v1.1.2
1111
github.com/oapi-codegen/oapi-codegen/v2 v2.0.0-00010101000000-000000000000
1212
github.com/oapi-codegen/testutil v1.1.0
1313
github.com/stretchr/testify v1.11.1
1414
)
1515

1616
require (
17-
github.com/davecgh/go-spew v1.1.1 // indirect
18-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
17+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
18+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
1919
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect
20-
github.com/go-openapi/jsonpointer v0.21.0 // indirect
21-
github.com/go-openapi/swag v0.23.0 // indirect
22-
github.com/goccy/go-json v0.10.2 // indirect
20+
github.com/go-openapi/jsonpointer v0.22.4 // indirect
21+
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
22+
github.com/goccy/go-json v0.10.3 // indirect
2323
github.com/gorilla/mux v1.8.1 // indirect
2424
github.com/josharian/intern v1.0.0 // indirect
2525
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
2626
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
2727
github.com/lestrrat-go/httpcc v1.0.1 // indirect
2828
github.com/lestrrat-go/iter v1.0.2 // indirect
2929
github.com/lestrrat-go/option v1.0.1 // indirect
30-
github.com/mailru/easyjson v0.7.7 // indirect
30+
github.com/mailru/easyjson v0.9.1 // indirect
3131
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
3232
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect
3333
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect
3434
github.com/perimeterx/marshmallow v1.1.5 // indirect
3535
github.com/pkg/errors v0.9.1 // indirect
36-
github.com/pmezard/go-difflib v1.0.0 // indirect
36+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
3737
github.com/speakeasy-api/jsonpath v0.6.0 // indirect
38-
github.com/speakeasy-api/openapi-overlay v0.10.2 // indirect
38+
github.com/speakeasy-api/openapi-overlay v0.10.3 // indirect
3939
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
40-
github.com/woodsbury/decimal128 v1.3.0 // indirect
41-
golang.org/x/crypto v0.22.0 // indirect
42-
golang.org/x/mod v0.23.0 // indirect
43-
golang.org/x/sync v0.11.0 // indirect
44-
golang.org/x/text v0.20.0 // indirect
45-
golang.org/x/tools v0.30.0 // indirect
40+
github.com/woodsbury/decimal128 v1.4.0 // indirect
41+
golang.org/x/crypto v0.32.0 // indirect
42+
golang.org/x/mod v0.33.0 // indirect
43+
golang.org/x/sync v0.19.0 // indirect
44+
golang.org/x/text v0.34.0 // indirect
45+
golang.org/x/tools v0.42.0 // indirect
4646
gopkg.in/yaml.v2 v2.4.0 // indirect
4747
gopkg.in/yaml.v3 v3.0.1 // indirect
4848
)

0 commit comments

Comments
 (0)