From 69dc7b1280e58dac05ab46c423b5b7f14cc88fab Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Wed, 26 Feb 2025 12:36:21 +0900 Subject: [PATCH] Update the supported version to the same as Go itself (#1967) Some of our dependences require the supported versions of Go. For example github.com/golang/crypto now requires 1.23 or higher. See: https://github.com/golang/crypto/commit/89ff08d67c4d79f9ac619aaf1f7388888798651fa For more information on the new policy of the Go team see: https://github.com/golang/go/issues/69095 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- README.md | 4 +++- fs_fs_test.go | 2 +- go.mod | 4 ++-- go.sum | 4 ++-- server.go | 8 -------- server_test.go | 2 +- 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1ba4d2..d42754f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.22.x, 1.23.x, 1.24.x] + go-version: [1.23.x, 1.24.x] os: [ubuntu-latest, macos-latest, windows-latest, macos-14] runs-on: ${{ matrix.os }} steps: diff --git a/README.md b/README.md index 7671f02..589e9e6 100644 --- a/README.md +++ b/README.md @@ -603,7 +603,9 @@ This is an **unsafe** way, the result string and `[]byte` buffer share the same * *Which GO versions are supported by fasthttp?* - Go 1.22.x and newer. Older versions might work, but won't officially be supported. + We support the same versions the Go team supports. + Currently that is Go 1.23.x and newer. + Older versions might work, but won't officially be supported. * *Please provide real benchmark data and server information* diff --git a/fs_fs_test.go b/fs_fs_test.go index dd767d8..d9cd36c 100644 --- a/fs_fs_test.go +++ b/fs_fs_test.go @@ -297,7 +297,7 @@ func TestFSFSCompressConcurrent(t *testing.T) { for i := 0; i < concurrency; i++ { select { case <-ch: - case <-time.After(time.Second * 2): + case <-time.After(time.Second * 4): t.Fatalf("timeout") } } diff --git a/go.mod b/go.mod index 59dc65e..3931243 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ module github.com/valyala/fasthttp -go 1.22 +go 1.23.0 require ( github.com/andybalholm/brotli v1.1.1 github.com/klauspost/compress v1.18.0 github.com/valyala/bytebufferpool v1.0.0 - golang.org/x/crypto v0.33.0 + golang.org/x/crypto v0.35.0 golang.org/x/net v0.35.0 golang.org/x/sys v0.30.0 ) diff --git a/go.sum b/go.sum index 1fe0ca4..b09aef1 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= -golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= -golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= diff --git a/server.go b/server.go index 4e44122..3f871cf 100644 --- a/server.go +++ b/server.go @@ -1704,10 +1704,6 @@ func (s *Server) ServeTLS(ln net.Listener, certFile, keyFile string) error { } } - // BuildNameToCertificate has been deprecated since 1.14. - // But since we also support older versions we'll keep this here. - s.TLSConfig.BuildNameToCertificate() //nolint:staticcheck - s.mu.Unlock() return s.Serve( @@ -1732,10 +1728,6 @@ func (s *Server) ServeTLSEmbed(ln net.Listener, certData, keyData []byte) error } } - // BuildNameToCertificate has been deprecated since 1.14. - // But since we also support older versions we'll keep this here. - s.TLSConfig.BuildNameToCertificate() //nolint:staticcheck - s.mu.Unlock() return s.Serve( diff --git a/server_test.go b/server_test.go index c0ab2ce..da275ef 100644 --- a/server_test.go +++ b/server_test.go @@ -3657,7 +3657,7 @@ func TestCloseOnShutdown(t *testing.T) { done := 0 for { select { - case <-time.After(time.Second): + case <-time.After(time.Second * 2): t.Fatal("shutdown took too long") case <-serveCh: done++