Skip to content
Myr

chore: bump minimum Go version to 1.24 and update workflows (#4388)

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

- Update minimum required Go version from 1.23 to 1.24 throughout documentation, warnings, and tests - Remove Go 1.23 from the GitHub Actions workflow matrix - Change single quotes to double quotes for consistency in workflow configuration

authored by Bo-Yi Wu · committed by GitHub · parent 48a5dca · Browse files · 5 files+12 added−12 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: Bo-Yi Wu <appleboy.tw@gmail.com>

Diff stats

5 files+12 added−12 removed

  • other:+12 added−12 removed

5 files+12 added−12 removed

modified:.github/workflows/gin.yml+5 added-5 removed
modified:context_test.go+4 added-4 removed
3318 unmodified lines
3319 assert.Contains(t, setCookie, "Domain=localhost")3320 assert.Contains(t, setCookie, "Max-Age=1")3321 assert.Contains(t, setCookie, "HttpOnly")3322 assert.Contains(t, setCookie, "Secure")3323 // SameSite=Lax might be omitted in Go 1.23+ as it's the default3323 // SameSite=Lax might be omitted in Go 1.24+ as it's the default3324 // assert.Contains(t, setCookie, "SameSite=Lax")33253326 // Test that when Path is empty, "/" is automatically set3327 cookie = &http.Cookie{
12 unmodified lines
3340 assert.Contains(t, setCookie, "Domain=localhost")3341 assert.Contains(t, setCookie, "Max-Age=1")3342 assert.Contains(t, setCookie, "HttpOnly")3343 assert.Contains(t, setCookie, "Secure")3344 // SameSite=Lax might be omitted in Go 1.23+ as it's the default3344 // SameSite=Lax might be omitted in Go 1.24+ as it's the default3345 // assert.Contains(t, setCookie, "SameSite=Lax")33463347 // Test additional cookie attributes (Expires)3348 expireTime := time.Now().Add(24 * time.Hour)
14 unmodified lines
3363 assert.Contains(t, setCookie, "Path=/")3364 assert.Contains(t, setCookie, "Domain=localhost")3365 assert.Contains(t, setCookie, "HttpOnly")3366 assert.Contains(t, setCookie, "Secure")3367 // SameSite=Lax might be omitted in Go 1.23+ as it's the default3367 // SameSite=Lax might be omitted in Go 1.24+ as it's the default3368 // assert.Contains(t, setCookie, "SameSite=Lax")33693370 // Test for Partitioned attribute (Go 1.18+)3371 cookie = &http.Cookie{
11 unmodified lines
3383 assert.Contains(t, setCookie, "Path=/")3384 assert.Contains(t, setCookie, "Domain=localhost")3385 assert.Contains(t, setCookie, "HttpOnly")3386 assert.Contains(t, setCookie, "Secure")3387 // SameSite=Lax might be omitted in Go 1.23+ as it's the default3387 // SameSite=Lax might be omitted in Go 1.24+ as it's the default3388 // assert.Contains(t, setCookie, "SameSite=Lax")3389 // Not testing for Partitioned attribute as it may not be supported in all Go versions33903391 // Test that SameSiteStrictMode is explicitly included in the header
249 unmodified lines
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.23+.\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.24+.\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.23+.81 debugPrint(`[WARNING] Now Gin requires Go 1.24+.8283`)84 }85 debugPrint(`[WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
27 unmodified lines
modified:README.md+1 added-1 removed
41 unmodified lines
42## Getting Started4344### Prerequisites4546- **Go version**: Gin requires [Go](https://go.dev/) version [1.23](https://go.dev/doc/devel/release#go1.23.0) or above46- **Go version**: Gin requires [Go](https://go.dev/) version [1.24](https://go.dev/doc/devel/release#go1.24.0) or above47- **Basic Go knowledge**: Familiarity with Go syntax and package management is helpful4849### Installation50
174 unmodified lines