From 5f39d3cb54bcf8e6fe0e0184b58efe8ec7b4efa9 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 8 Oct 2025 08:18:45 +0800 Subject: [PATCH] chore: bump minimum Go version to 1.24 and update workflows - 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 Signed-off-by: Bo-Yi Wu --- .github/workflows/gin.yml | 10 +++++----- README.md | 2 +- context_test.go | 8 ++++---- debug.go | 2 +- debug_test.go | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gin.yml b/.github/workflows/gin.yml index e0210214..f61c6486 100644 --- a/.github/workflows/gin.yml +++ b/.github/workflows/gin.yml @@ -33,7 +33,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - go: ["1.23", "1.24", "1.25"] + go: ["1.24", "1.25"] test-tags: [ "", @@ -92,8 +92,8 @@ jobs: - name: Run Trivy vulnerability scanner in repo mode uses: aquasecurity/trivy-action@0.33.1 with: - scan-type: 'fs' + scan-type: "fs" ignore-unfixed: true - format: 'table' - exit-code: '1' - severity: 'CRITICAL,HIGH,MEDIUM' + format: "table" + exit-code: "1" + severity: "CRITICAL,HIGH,MEDIUM" diff --git a/README.md b/README.md index 8343a55b..629cb98d 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Gin combines the simplicity of Express.js-style routing with Go's performance ch ### Prerequisites -- **Go version**: Gin requires [Go](https://go.dev/) version [1.23](https://go.dev/doc/devel/release#go1.23.0) or above +- **Go version**: Gin requires [Go](https://go.dev/) version [1.24](https://go.dev/doc/devel/release#go1.24.0) or above - **Basic Go knowledge**: Familiarity with Go syntax and package management is helpful ### Installation diff --git a/context_test.go b/context_test.go index 08ffc3f6..cc066ef8 100644 --- a/context_test.go +++ b/context_test.go @@ -3320,7 +3320,7 @@ func TestContextSetCookieData(t *testing.T) { assert.Contains(t, setCookie, "Max-Age=1") assert.Contains(t, setCookie, "HttpOnly") assert.Contains(t, setCookie, "Secure") - // SameSite=Lax might be omitted in Go 1.23+ as it's the default + // SameSite=Lax might be omitted in Go 1.24+ as it's the default // assert.Contains(t, setCookie, "SameSite=Lax") // Test that when Path is empty, "/" is automatically set @@ -3341,7 +3341,7 @@ func TestContextSetCookieData(t *testing.T) { assert.Contains(t, setCookie, "Max-Age=1") assert.Contains(t, setCookie, "HttpOnly") assert.Contains(t, setCookie, "Secure") - // SameSite=Lax might be omitted in Go 1.23+ as it's the default + // SameSite=Lax might be omitted in Go 1.24+ as it's the default // assert.Contains(t, setCookie, "SameSite=Lax") // Test additional cookie attributes (Expires) @@ -3364,7 +3364,7 @@ func TestContextSetCookieData(t *testing.T) { assert.Contains(t, setCookie, "Domain=localhost") assert.Contains(t, setCookie, "HttpOnly") assert.Contains(t, setCookie, "Secure") - // SameSite=Lax might be omitted in Go 1.23+ as it's the default + // SameSite=Lax might be omitted in Go 1.24+ as it's the default // assert.Contains(t, setCookie, "SameSite=Lax") // Test for Partitioned attribute (Go 1.18+) @@ -3384,7 +3384,7 @@ func TestContextSetCookieData(t *testing.T) { assert.Contains(t, setCookie, "Domain=localhost") assert.Contains(t, setCookie, "HttpOnly") assert.Contains(t, setCookie, "Secure") - // SameSite=Lax might be omitted in Go 1.23+ as it's the default + // SameSite=Lax might be omitted in Go 1.24+ as it's the default // assert.Contains(t, setCookie, "SameSite=Lax") // Not testing for Partitioned attribute as it may not be supported in all Go versions diff --git a/debug.go b/debug.go index 7fe2762e..f22dfd87 100644 --- a/debug.go +++ b/debug.go @@ -78,7 +78,7 @@ func getMinVer(v string) (uint64, error) { func debugPrintWARNINGDefault() { if v, e := getMinVer(runtime.Version()); e == nil && v < ginSupportMinGoVer { - debugPrint(`[WARNING] Now Gin requires Go 1.23+. + debugPrint(`[WARNING] Now Gin requires Go 1.24+. `) } diff --git a/debug_test.go b/debug_test.go index 59b61beb..e9d8fe01 100644 --- a/debug_test.go +++ b/debug_test.go @@ -106,7 +106,7 @@ func TestDebugPrintWARNINGDefault(t *testing.T) { }) m, e := getMinVer(runtime.Version()) if e == nil && m < ginSupportMinGoVer { - 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) + 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) } else { assert.Equal(t, "[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n", re) }