Update all go-zero examples to Go 1.21 and go-zero v1.9.0 #526
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.
This PR systematically updates all examples in the repository to use the latest versions of Go (1.21) and go-zero (v1.9.0), as requested in the issue. The updates ensure compatibility and take advantage of the latest features and improvements.
Changes Made
Main Repository
go.mod
to use Go 1.21 and go-zero v1.9.0 (already current)go mod tidy
Example Modules Updated (23 total)
All example modules have been updated from various older versions to the current standards:
HTTP Examples (9 modules):
http/cors
: Go 1.17 → 1.21, go-zero v1.5.4 → v1.9.0http/timeout
: Go 1.18 → 1.21, go-zero v1.5.5 → v1.9.0http/jwt
: Go 1.15 → 1.21, go-zero v1.3.2 → v1.9.0 (removed outdated gRPC version constraint)http/sse
: Go 1.21.13 → 1.21, go-zero v1.8.1 → v1.9.0http/static
: Go 1.18 → 1.21, go-zero v1.5.6 → v1.9.0http/withtimeout
: Go 1.17 → 1.21, go-zero v1.5.4 → v1.9.0http/upload
: Go 1.17 → 1.21, go-zero v1.5.5 → v1.9.0http/group
: Go 1.17 → 1.21, go-zero v1.5.4 → v1.9.0http/download
: Go 1.17 → 1.21, go-zero v1.5.4 → v1.9.0Logging Examples (6 modules):
logx/zerolog
: Go 1.18 → 1.21, go-zero v1.5.4 → v1.9.0logx/fileconsole
: Go 1.18 → 1.21, go-zero v1.5.4 → v1.9.0logx/zaplog
: Go 1.18 → 1.21, go-zero v1.5.4 → v1.9.0logx/filterfields
: Go 1.18 → 1.21, go-zero v1.5.5 → v1.9.0logx/logrus
: Go 1.18 → 1.21, go-zero v1.5.5 → v1.9.0logx/tokafka
: Go 1.18 → 1.21, go-zero v1.5.4 → v1.9.0Other Examples (8 modules):
discovery/consul
: Go 1.17 → 1.21, go-zero v1.5.4 → v1.9.0config/fromtoml
: Go 1.18 → 1.21, go-zero v1.5.6 → v1.9.0gateway
: Go 1.19 → 1.21, go-zero v1.5.4 → v1.9.0shorturl
: Go 1.15 → 1.21, go-zero v1.5.4 → v1.9.0bookstore
: Go 1.15 → 1.21, go-zero v1.5.4 → v1.9.0servicegroup
: Go 1.18 → 1.21, go-zero v1.5.6 → v1.9.0monolithic
: Go 1.18 → 1.21, go-zero v1.5.4 → v1.9.0rpc/tls/shorturl
: Go 1.17 → 1.21, go-zero v1.5.4 → v1.9.0Implementation Details
https://proxy.golang.org,direct
) for reliable dependency managementgo mod tidy
for each module to refresh indirect dependenciesNotes
This update brings the entire repository up to current standards and provides users with examples that leverage the latest go-zero features and improvements.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
goproxy.cn
go mod tidy
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Created from VS Code via the GitHub Pull Request extension.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.