From 91cf015e41af5a2632f34e785a984fb8d7716f15 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 15 Mar 2026 22:02:45 +0800 Subject: [PATCH 1/4] ci: bump up Go version to 1.26 (#755) --- .github/workflows/test.yml | 10 ++++++++-- .github/workflows/test_gc_opt.yml | 3 +-- .github/workflows/test_poll_opt.yml | 8 +++++--- .github/workflows/test_poll_opt_gc_opt.yml | 8 +++++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 865f3a254..8444ebf6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: strategy: fail-fast: false matrix: - go: ['1.20', '1.25'] + go: ['1.20', '1.26'] os: - ubuntu-latest - macos-14 # check out this issue: https://github.com/actions/runner-images/issues/10924 @@ -90,8 +90,14 @@ jobs: - name: Run unit tests for packages run: go test $(go list ./... | tail -n +2) + # NOTE: -race is conditionally disabled for Windows with Go 1.26 due to + # known instability of the Go race detector on this platform/version + # combination (intermittent crashes and timeouts observed in CI). + # This is likely a regression in Go 1.26 on Windows. Check out #752 and #754 for details. + # Once the underlying issue is resolved and CI is stable, this + # condition should be revisited so that race testing can be re-enabled. - name: Run integration tests - run: go test -v -race -coverprofile="codecov.report" -covermode=atomic -timeout 15m -failfast + run: go test -v ${{ !(runner.os == 'Windows' && startsWith(matrix.go, '1.26')) && '-race' || '' }} -coverprofile="codecov.report" -covermode=atomic -timeout 15m -failfast - name: Upload the code coverage report to codecov.io uses: codecov/codecov-action@v5 diff --git a/.github/workflows/test_gc_opt.yml b/.github/workflows/test_gc_opt.yml index 72f14763c..ffeb2ebd9 100644 --- a/.github/workflows/test_gc_opt.yml +++ b/.github/workflows/test_gc_opt.yml @@ -56,11 +56,10 @@ jobs: strategy: fail-fast: false matrix: - go: ['1.20', '1.25'] + go: ['1.20', '1.26'] os: - ubuntu-latest - macos-14 # check out this issue: https://github.com/actions/runner-images/issues/10924 - - windows-latest name: Go ${{ matrix.go }} @ ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/test_poll_opt.yml b/.github/workflows/test_poll_opt.yml index 5e5aa4be8..63164295a 100644 --- a/.github/workflows/test_poll_opt.yml +++ b/.github/workflows/test_poll_opt.yml @@ -55,8 +55,10 @@ jobs: strategy: fail-fast: false matrix: - go: ['1.20', '1.25'] - os: [ubuntu-latest, macos-14] # check out this issue: https://github.com/actions/runner-images/issues/10924 + go: ['1.20', '1.26'] + os: + - ubuntu-latest + - macos-14 # check out this issue: https://github.com/actions/runner-images/issues/10924 name: Go ${{ matrix.go }} @ ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: @@ -68,7 +70,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '^1.20' + go-version: ${{ matrix.go }} - name: Print Go environment id: go-env diff --git a/.github/workflows/test_poll_opt_gc_opt.yml b/.github/workflows/test_poll_opt_gc_opt.yml index 1b8308a74..54602d53e 100644 --- a/.github/workflows/test_poll_opt_gc_opt.yml +++ b/.github/workflows/test_poll_opt_gc_opt.yml @@ -55,8 +55,10 @@ jobs: strategy: fail-fast: false matrix: - go: ['1.20', '1.25'] - os: [ubuntu-latest, macos-14] # check out this issue: https://github.com/actions/runner-images/issues/10924 + go: ['1.20', '1.26'] + os: + - ubuntu-latest + - macos-14 # check out this issue: https://github.com/actions/runner-images/issues/10924 name: Go ${{ matrix.go }} @ ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: @@ -68,7 +70,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '^1.20' + go-version: ${{ matrix.go }} - name: Print Go environment id: go-env From b61405465ff64e01b8042d3ab8799996d4030b2c Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Wed, 1 Apr 2026 08:42:30 +0800 Subject: [PATCH 2/4] chore: use my referral link of DO --- README.md | 6 +----- README_ZH.md | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 44648cb73..25c8cc180 100644 --- a/README.md +++ b/README.md @@ -270,8 +270,4 @@ Please read the [Contributing Guidelines](CONTRIBUTING.md) before opening a PR a # 🔋 Sponsorship -

-

This project is supported by:

- - -

\ No newline at end of file +[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%203.svg)](https://www.digitalocean.com/?refcode=5d8774f42124&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge) diff --git a/README_ZH.md b/README_ZH.md index 3ff3e2e1b..c6d656dfc 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -270,8 +270,4 @@ Test duration : 15s # 🔋 赞助商 -

-

本项目由以下机构赞助:

- - -

\ No newline at end of file +[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%203.svg)](https://www.digitalocean.com/?refcode=5d8774f42124&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge) From dad475e990fd978c60c19cf9a9e67b5bd8f6fcc4 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Mon, 25 May 2026 09:45:42 +0800 Subject: [PATCH 3/4] chore: bump up Go modules --- go.mod | 10 +++++----- go.sum | 23 +++++++++++++---------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 7a3fce707..5bbe97782 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ module github.com/panjf2000/gnet/v2 require ( - github.com/panjf2000/ants/v2 v2.11.3 - github.com/stretchr/testify v1.10.0 + github.com/panjf2000/ants/v2 v2.12.1 + github.com/stretchr/testify v1.11.1 github.com/valyala/bytebufferpool v1.0.0 - go.uber.org/zap v1.27.0 - golang.org/x/sync v0.11.0 - golang.org/x/sys v0.30.0 + go.uber.org/zap v1.28.0 + golang.org/x/sync v0.20.0 + golang.org/x/sys v0.45.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) diff --git a/go.sum b/go.sum index 8e2d52cb7..77d6c6b9e 100644 --- a/go.sum +++ b/go.sum @@ -1,22 +1,25 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/panjf2000/ants/v2 v2.11.3 h1:AfI0ngBoXJmYOpDh9m516vjqoUu2sLrIVgppI9TZVpg= -github.com/panjf2000/ants/v2 v2.11.3/go.mod h1:8u92CYMUc6gyvTIw8Ru7Mt7+/ESnJahz5EVtqfrilek= +github.com/panjf2000/ants/v2 v2.12.1 h1:BWvU2wHpyXWxhhNXsGB6JXLCNbshyLd1QxvoAmZnu10= +github.com/panjf2000/ants/v2 v2.12.1/go.mod h1:tSQuaNQ6r6NRhPt+IZVUevvDyFMTs+eS4ztZc52uJTY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= +go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= From fd7ce4bef97582920c174b56a96cbbda7a5bcd42 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 25 May 2026 10:48:20 +0800 Subject: [PATCH 4/4] fix: downgrade x/sync and x/sys to versions compatible with Go 1.20 (#758) * fix: downgrade golang.org/x/sync and golang.org/x/sys to versions compatible with Go 1.20 golang.org/x/sync v0.20.0 and golang.org/x/sys v0.45.0 require Go 1.25+, but CI tests on Go 1.20. Revert these to v0.11.0 and v0.30.0 respectively. * docs: add version constraint comments to go.mod for x/sync and x/sys --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 5bbe97782..a8c2a76c6 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,8 @@ require ( github.com/stretchr/testify v1.11.1 github.com/valyala/bytebufferpool v1.0.0 go.uber.org/zap v1.28.0 - golang.org/x/sync v0.20.0 - golang.org/x/sys v0.45.0 + golang.org/x/sync v0.11.0 // don't upgrade beyond v0.11.0, v0.12.0+ requires Go 1.23+ + golang.org/x/sys v0.30.0 // don't upgrade beyond v0.30.0, v0.31.0+ requires Go 1.23+ gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) diff --git a/go.sum b/go.sum index 77d6c6b9e..bbadb5740 100644 --- a/go.sum +++ b/go.sum @@ -9,17 +9,15 @@ github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= -go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=