From 1f4fd6aafe7e7abd220b78e880bda7a6975c54b9 Mon Sep 17 00:00:00 2001 From: imcdd <36127407+imcdd@users.noreply.github.com> Date: Wed, 8 Mar 2023 15:27:26 +0800 Subject: [PATCH] 1. Fix wrong atomic pkg from go1.19 std sync/atomic to go.uber.org/atomic (#1479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2. Fix CI buildtest config '>=1.18' to '1.18',ensure compatibility with go1.18 --- .github/workflows/buildtest.yaml | 2 +- README.md | 2 +- pkg/rtc/subscriptionmanager.go | 2 +- pkg/rtc/subscriptionmanager_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index d0cbb6a39..4025f7fbb 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -21,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '>=1.18' + go-version: '1.18' - name: Set up gotestfmt run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@v2.4.1 diff --git a/README.md b/README.md index 8efdd144f..d3aad5166 100644 --- a/README.md +++ b/README.md @@ -246,7 +246,7 @@ Read our [deployment docs](https://docs.livekit.io/deploy/) for more information Pre-requisites: -- Go 1.16+ is installed +- Go 1.18+ is installed - GOPATH/bin is in your PATH Then run diff --git a/pkg/rtc/subscriptionmanager.go b/pkg/rtc/subscriptionmanager.go index 43fee0d39..da0d452ad 100644 --- a/pkg/rtc/subscriptionmanager.go +++ b/pkg/rtc/subscriptionmanager.go @@ -19,10 +19,10 @@ package rtc import ( "context" "sync" - "sync/atomic" "time" "github.com/pion/webrtc/v3/pkg/rtcerr" + "go.uber.org/atomic" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/sfu" diff --git a/pkg/rtc/subscriptionmanager_test.go b/pkg/rtc/subscriptionmanager_test.go index 983b73f45..aa4441c1e 100644 --- a/pkg/rtc/subscriptionmanager_test.go +++ b/pkg/rtc/subscriptionmanager_test.go @@ -18,11 +18,11 @@ package rtc import ( "sync" - "sync/atomic" "testing" "time" "github.com/stretchr/testify/require" + "go.uber.org/atomic" "github.com/livekit/livekit-server/pkg/rtc/types" "github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"