diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 5476438..61d2180 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -9,9 +9,12 @@ on: pull_request: permissions: + # Required: allow read access to the content for analysis. contents: read # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read + pull-requests: read + # Optional: allow write access to checks to allow the action to annotate code in the PR. + checks: write jobs: golangci: @@ -21,10 +24,10 @@ jobs: matrix: go: ['1.19', '1.20'] steps: - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Format run: go fmt @@ -33,7 +36,7 @@ jobs: run: go vet - name: lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 #with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version #version: v1.29 diff --git a/v2_test.go b/v2_test.go index 57592b3..7fef556 100644 --- a/v2_test.go +++ b/v2_test.go @@ -3,6 +3,7 @@ package proxyproto import ( "bufio" "bytes" + iorand "crypto/rand" "encoding/binary" "math/rand" "reflect" @@ -51,7 +52,7 @@ var ( fixtureUnixV2 = append(lengthUnixBytes, fixtureUnixAddress...) fixtureTLV = func() []byte { tlv := make([]byte, 2+rand.Intn(1<<12)) // Not enough to overflow, at least size two - rand.Read(tlv) + _, _ = iorand.Read(tlv) return tlv }() fixtureIPv4V2TLV = fixtureWithTLV(lengthV4Bytes, fixtureIPv4Address, fixtureTLV)