Skip to content
Myr

chore: update Go versions and dependencies for improved compatibility (#4187)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* chore: update Go versions and dependencies for improved compatibility - Update Go versions in workflow file to `1.23` and `1.24` - Enhance test tags in workflow with specific linker flags - Remove the conditional formatting step for Go `1.22.x` in workflow - Remove `goimports` settings from `.golangci.yml` - Update `go.mod` to use Go `1.23.0` - Upgrade `github.com/bytedance/sonic` from `v1.11.6` to `v1.13.1` - Update indirect dependencies `sonic/loader` to `v0.2.4` and `base64x` to `v0.1.5` in `go.mod` Signed-off-by: appleboy <appleboy.tw@gmail.com> * chore: update project for Go 1.23 compatibility and documentation fixes - Update Go version requirement from 1.22 to 1.23 in README.md - Remove superfluous `$` from example command in README.md - Update warning message to reflect new Go version requirement in debug.go - Update test assertion to reflect new Go version requirement in debug_test.go Signed-off-by: appleboy <appleboy.tw@gmail.com> ---------

authored by Bo-Yi Wu · committed by GitHub · parent ebe5e2a · Browse files · 7 files+22 added−25 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: appleboy <appleboy.tw@gmail.com>

Diff stats

7 files+22 added−25 removed

  • other:+22 added−25 removed

7 files+22 added−25 removed

modified:.github/workflows/gin.yml+8 added-6 removed
modified:.golangci.yml-2 removed
modified:debug_test.go+1 added-1 removed
104 unmodified lines
105 SetMode(TestMode)106 })107 m, e := getMinVer(runtime.Version())108 if e == nil && m < ginSupportMinGoVer {109 assert.Equal(t, "[GIN-debug] [WARNING] Now Gin requires Go 1.22+.\n\n[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", re)109 assert.Equal(t, "[GIN-debug] [WARNING] Now Gin requires Go 1.23+.\n\n[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", re)110 } else {111 assert.Equal(t, "[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", re)112 }113}
55 unmodified lines
modified:debug.go+1 added-1 removed
76 unmodified lines
77}7879func debugPrintWARNINGDefault() {80 if v, e := getMinVer(runtime.Version()); e == nil && v < ginSupportMinGoVer {81 debugPrint(`[WARNING] Now Gin requires Go 1.22+.81 debugPrint(`[WARNING] Now Gin requires Go 1.23+.8283`)84 }85 debugPrint(`[WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
27 unmodified lines
modified:go.mod+4 added-6 removed
1module github.com/gin-gonic/gin23go 1.224toolchain go1.23.73go 1.23.045require (7 github.com/bytedance/sonic v1.11.66 github.com/bytedance/sonic v1.13.17 github.com/gin-contrib/sse v0.1.08 github.com/go-playground/validator/v10 v10.22.19 github.com/goccy/go-json v0.10.210 github.com/json-iterator/go v1.1.12
7 unmodified lines
18 gopkg.in/yaml.v3 v3.0.119)2021require (23 github.com/bytedance/sonic/loader v0.1.1 // indirect24 github.com/cloudwego/base64x v0.1.4 // indirect25 github.com/cloudwego/iasm v0.2.0 // indirect22 github.com/bytedance/sonic/loader v0.2.4 // indirect23 github.com/cloudwego/base64x v0.1.5 // indirect24 github.com/davecgh/go-spew v1.1.1 // indirect25 github.com/gabriel-vasile/mimetype v1.4.3 // indirect26 github.com/go-playground/locales v0.14.1 // indirect27 github.com/go-playground/universal-translator v0.18.1 // indirect
19 unmodified lines
modified:go.sum+6 added-7 removed
1github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0=2github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=3github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=1github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g=2github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=3github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=4github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY=5github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=6github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=7github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=8github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=8github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=9github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=10github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=9github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4=10github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=11github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=12github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=13github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=14github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
96 unmodified lines
111gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=112gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=113gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=114nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=115rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
modified:README.md+2 added-2 removed
28 unmodified lines
29## Getting started3031### Prerequisites3233Gin requires [Go](https://go.dev/) version [1.22](https://go.dev/doc/devel/release#go1.22.0) or above.33Gin requires [Go](https://go.dev/) version [1.23](https://go.dev/doc/devel/release#go1.23.0) or above.3435### Getting Gin3637With [Go's module support](https://go.dev/wiki/Modules#how-to-use-modules), `go [build|run|test]` automatically fetches the necessary dependencies when you add the import in your code:
34 unmodified lines
7273To run the code, use the `go run` command, like:7475```sh76$ go run example.go76go run example.go77```7879Then visit [`0.0.0.0:8080/ping`](http://0.0.0.0:8080/ping) in your browser to see the response!80
92 unmodified lines