-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Update all dependencies to Go 1.24 #2264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mromaszewicz
merged 7 commits into
oapi-codegen:main
from
mromaszewicz:maintenance/go124
Mar 2, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cf8ad94
chore: require go 1.24 as minimum version across all modules
mromaszewicz 64d917e
chore: remove inner go.mod files that existed only for go 1.24 requir…
mromaszewicz edb66bd
chore: update dependencies to latest go 1.24-compatible versions
mromaszewicz 98be7c0
update readme
mromaszewicz d18ad90
ci: skip Go 1.22 and 1.23 in CI matrix
mromaszewicz 098b493
chore: remove Go version guards from child module Makefiles
mromaszewicz 897f8a8
chore: update deprecated code
mromaszewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,8 +42,6 @@ go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest | |
|
|
||
| ## Install | ||
|
|
||
| ### For Go 1.24+ | ||
|
|
||
| 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. | ||
|
|
||
| To do this, you run `go get -tool`: | ||
|
|
@@ -59,29 +57,6 @@ From there, each invocation of `oapi-codegen` would be used like so: | |
| //go:generate go tool oapi-codegen -config cfg.yaml ../../api.yaml | ||
| ``` | ||
|
|
||
| ### Prior to Go 1.24 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO this pattern may still be used by folks - especially with a separate |
||
|
|
||
| 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. | ||
|
|
||
| This would give you a `tools/tools.go`: | ||
|
|
||
| ```go | ||
| //go:build tools | ||
| // +build tools | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| _ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen" | ||
| ) | ||
| ``` | ||
|
|
||
| Then, each invocation of `oapi-codegen` would be used like so: | ||
|
|
||
| ```go | ||
| //go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../../api.yaml | ||
| ``` | ||
|
|
||
| Alternatively, you can install it as a binary with: | ||
|
|
||
| ```sh | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,17 @@ | ||
| SHELL:=/bin/bash | ||
|
|
||
| YELLOW := \e[0;33m | ||
| RESET := \e[0;0m | ||
|
|
||
| GOVER := $(shell go env GOVERSION) | ||
| GOMINOR := $(shell bash -c "cut -f1 -d' ' <<< \"$(GOVER)\" | cut -f2 -d.") | ||
|
|
||
| define execute-if-go-122 | ||
| @{ \ | ||
| if [[ 22 -le $(GOMINOR) ]]; then \ | ||
| $1; \ | ||
| else \ | ||
| echo -e "$(YELLOW)Skipping task as you're running Go v1.$(GOMINOR).x which is < Go 1.22, which this module requires$(RESET)"; \ | ||
| fi \ | ||
| } | ||
| endef | ||
|
|
||
| lint: | ||
| $(call execute-if-go-122,$(GOBIN)/golangci-lint run ./...) | ||
| $(GOBIN)/golangci-lint run ./... | ||
|
|
||
| lint-ci: | ||
|
|
||
| $(call execute-if-go-122,$(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m) | ||
| $(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m | ||
|
|
||
| generate: | ||
| $(call execute-if-go-122,go generate ./...) | ||
| go generate ./... | ||
|
|
||
| test: | ||
| $(call execute-if-go-122,go test -cover ./...) | ||
| go test -cover ./... | ||
|
|
||
| tidy: | ||
| $(call execute-if-go-122,go mod tidy) | ||
| go mod tidy | ||
|
|
||
| tidy-ci: | ||
| $(call execute-if-go-122,tidied -verbose) | ||
| tidied -verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,48 @@ | ||
| module github.com/oapi-codegen/oapi-codegen/v2/examples/authenticated-api/stdhttp | ||
|
|
||
| go 1.22.5 | ||
| go 1.24.3 | ||
|
|
||
| replace github.com/oapi-codegen/oapi-codegen/v2 => ../../../ | ||
|
|
||
| require ( | ||
| github.com/getkin/kin-openapi v0.133.0 | ||
| github.com/lestrrat-go/jwx v1.2.29 | ||
| github.com/oapi-codegen/nethttp-middleware v1.0.2 | ||
| github.com/lestrrat-go/jwx v1.2.31 | ||
| github.com/oapi-codegen/nethttp-middleware v1.1.2 | ||
| github.com/oapi-codegen/oapi-codegen/v2 v2.0.0-00010101000000-000000000000 | ||
| github.com/oapi-codegen/testutil v1.1.0 | ||
| github.com/stretchr/testify v1.11.1 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/davecgh/go-spew v1.1.1 // indirect | ||
| github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect | ||
| github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
| github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect | ||
| github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect | ||
| github.com/go-openapi/jsonpointer v0.21.0 // indirect | ||
| github.com/go-openapi/swag v0.23.0 // indirect | ||
| github.com/goccy/go-json v0.10.2 // indirect | ||
| github.com/go-openapi/jsonpointer v0.22.4 // indirect | ||
| github.com/go-openapi/swag/jsonname v0.25.4 // indirect | ||
| github.com/goccy/go-json v0.10.3 // indirect | ||
| github.com/gorilla/mux v1.8.1 // indirect | ||
| github.com/josharian/intern v1.0.0 // indirect | ||
| github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect | ||
| github.com/lestrrat-go/blackmagic v1.0.2 // indirect | ||
| github.com/lestrrat-go/httpcc v1.0.1 // indirect | ||
| github.com/lestrrat-go/iter v1.0.2 // indirect | ||
| github.com/lestrrat-go/option v1.0.1 // indirect | ||
| github.com/mailru/easyjson v0.7.7 // indirect | ||
| github.com/mailru/easyjson v0.9.1 // indirect | ||
| github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect | ||
| github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect | ||
| github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect | ||
| github.com/perimeterx/marshmallow v1.1.5 // indirect | ||
| github.com/pkg/errors v0.9.1 // indirect | ||
| github.com/pmezard/go-difflib v1.0.0 // indirect | ||
| github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
| github.com/speakeasy-api/jsonpath v0.6.0 // indirect | ||
| github.com/speakeasy-api/openapi-overlay v0.10.2 // indirect | ||
| github.com/speakeasy-api/openapi-overlay v0.10.3 // indirect | ||
| github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect | ||
| github.com/woodsbury/decimal128 v1.3.0 // indirect | ||
| golang.org/x/crypto v0.22.0 // indirect | ||
| golang.org/x/mod v0.23.0 // indirect | ||
| golang.org/x/sync v0.11.0 // indirect | ||
| golang.org/x/text v0.20.0 // indirect | ||
| golang.org/x/tools v0.30.0 // indirect | ||
| github.com/woodsbury/decimal128 v1.4.0 // indirect | ||
| golang.org/x/crypto v0.32.0 // indirect | ||
| golang.org/x/mod v0.33.0 // indirect | ||
| golang.org/x/sync v0.19.0 // indirect | ||
| golang.org/x/text v0.34.0 // indirect | ||
| golang.org/x/tools v0.42.0 // indirect | ||
| gopkg.in/yaml.v2 v2.4.0 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do this upstream in the actions repo (after this change) and then that'll mean we can roll out minimum Go 1.24 across all our repos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we have to update all the others first. I'll do that next.