From f30ff175b6b68beec9317ef1286eddc20f88bd5f Mon Sep 17 00:00:00 2001 From: streamer45 Date: Wed, 25 Sep 2024 11:23:09 -0600 Subject: [PATCH] Update Golang to v1.22 --- .github/workflows/ci.yml | 18 +++++++----------- .github/workflows/golangci-lint.yml | 18 ++++++------------ .golangci.yml | 2 +- client/helper_test.go | 8 ++++---- go.mod | 2 +- go.sum | 2 -- 6 files changed, 19 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e90ea92..1237264 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,25 +9,21 @@ jobs: run: working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} - strategy: - matrix: - go-version: [1.21.x] - runs-on: ubuntu-latest-4-cores steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} + go-version-file: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}/go.mod - name: Install Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: '20.11' - - name: Checkout Code - uses: actions/checkout@v2 - with: - path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} - name: Execute Tests run: | go mod download diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3c4d644..113d184 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -5,21 +5,15 @@ permissions: jobs: golangci: name: lint - strategy: - matrix: - go-version: [1.21.x] runs-on: ubuntu-latest steps: + - name: Checkout Code + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} - - name: Checkout Code - uses: actions/checkout@v2 + go-version-file: go.mod - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v6 with: - version: v1.57.2 - - # Optional: if set to true then the action will use pre-installed Go. - skip-go-installation: true + version: v1.61.0 diff --git a/.golangci.yml b/.golangci.yml index 69f985f..0ab9424 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,7 +22,7 @@ linters: - ineffassign # Detects when assignments to existing variables are not used - unconvert # Removes unnecessary type conversions - unused # Checks Go code for unused constants, variables, functions and types - - exportloopref # Checks for pointers to enclosing loop variables + - copyloopvar # Checks for pointers to enclosing loop variables - errcheck # Detects unchecked errors - misspell # Finds commonly misspelled English words - goimports # Check import statements are formatted according to the 'goimports' command diff --git a/client/helper_test.go b/client/helper_test.go index dac4367..8b39e5f 100644 --- a/client/helper_test.go +++ b/client/helper_test.go @@ -91,13 +91,13 @@ func (th *TestHelper) screenTrackWriter(track *webrtc.TrackLocalStaticRTP, close // Open a IVF file and start reading using our IVFReader file, ivfErr := os.Open(filename) if ivfErr != nil { - log.Fatalf(ivfErr.Error()) + log.Fatal(ivfErr.Error()) } defer file.Close() ivf, header, ivfErr := ivfreader.NewWith(file) if ivfErr != nil { - log.Fatalf(ivfErr.Error()) + log.Fatal(ivfErr.Error()) } // Send our video file frame at a time. Pace our sending so we send it at the same speed it should be played back as. @@ -125,14 +125,14 @@ func (th *TestHelper) screenTrackWriter(track *webrtc.TrackLocalStaticRTP, close _, _ = file.Seek(0, 0) ivf, header, ivfErr = ivfreader.NewWith(file) if ivfErr != nil { - log.Fatalf(ivfErr.Error()) + log.Fatal(ivfErr.Error()) } return file }) frame, _, ivfErr = ivf.ParseNextFrame() } if ivfErr != nil { - log.Fatalf(ivfErr.Error()) + log.Fatal(ivfErr.Error()) } packets := packetizer.Packetize(frame, 90000/header.TimebaseDenominator) diff --git a/go.mod b/go.mod index d0eb0e1..0b4e1c9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mattermost/rtcd -go 1.21.9 +go 1.22.7 require ( git.mills.io/prologic/bitcask v1.0.2 diff --git a/go.sum b/go.sum index 20d2b40..349072c 100644 --- a/go.sum +++ b/go.sum @@ -348,8 +348,6 @@ github.com/pion/transport/v2 v2.2.2/go.mod h1:OJg3ojoBJopjEeECq2yJdXH9YVrUJ1uQ++ github.com/pion/transport/v2 v2.2.3/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pion/transport/v2 v2.2.4 h1:41JJK6DZQYSeVLxILA2+F4ZkKb4Xd/tFJZRFZQ9QAlo= github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= -github.com/pion/transport/v2 v2.2.5 h1:iyi25i/21gQck4hfRhomF6SktmUQjRsRW4WJdhfc3Kc= -github.com/pion/transport/v2 v2.2.5/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLhCCgpRK4p0= github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0= github.com/pion/transport/v3 v3.0.2 h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4= github.com/pion/transport/v3 v3.0.2/go.mod h1:nIToODoOlb5If2jF9y2Igfx3PFYWfuXi37m0IlWa/D0=