Skip to content

Commit 032d60c

Browse files
pionbotSean-Der
authored andcommittedAug 16, 2024·
Update CI configs to v0.11.15
Update lint scripts and CI configs.
1 parent f6ecbc2 commit 032d60c

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed
 

‎.github/workflows/test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: pion/.goassets/.github/workflows/test.reusable.yml@master
2424
strategy:
2525
matrix:
26-
go: ["1.22", "1.21"] # auto-update/supported-go-version-list
26+
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
2727
fail-fast: false
2828
with:
2929
go-version: ${{ matrix.go }}
@@ -33,13 +33,13 @@ jobs:
3333
uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master
3434
strategy:
3535
matrix:
36-
go: ["1.22", "1.21"] # auto-update/supported-go-version-list
36+
go: ["1.23", "1.22"] # auto-update/supported-go-version-list
3737
fail-fast: false
3838
with:
3939
go-version: ${{ matrix.go }}
4040

4141
test-wasm:
4242
uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master
4343
with:
44-
go-version: "1.22" # auto-update/latest-go-version
44+
go-version: "1.23" # auto-update/latest-go-version
4545
secrets: inherit

‎.golangci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
22
# SPDX-License-Identifier: MIT
33

4+
run:
5+
timeout: 5m
6+
47
linters-settings:
58
govet:
69
enable:
@@ -48,7 +51,7 @@ linters:
4851
- goconst # Finds repeated strings that could be replaced by a constant
4952
- gocritic # The most opinionated Go source code linter
5053
- godox # Tool for detection of FIXME, TODO and other comment keywords
51-
- goerr113 # Golang linter to check the errors handling expressions
54+
- err113 # Golang linter to check the errors handling expressions
5255
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
5356
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
5457
- goheader # Checks is file header matches to pattern
@@ -83,17 +86,14 @@ linters:
8386
- depguard # Go linter that checks if package imports are in a list of acceptable packages
8487
- containedctx # containedctx is a linter that detects struct contained context.Context field
8588
- cyclop # checks function and package cyclomatic complexity
86-
- exhaustivestruct # Checks if all struct's fields are initialized
8789
- funlen # Tool for detection of long functions
8890
- gocyclo # Computes and checks the cyclomatic complexity of functions
8991
- godot # Check if comments end in a period
9092
- gomnd # An analyzer to detect magic numbers.
91-
- ifshort # Checks that your code uses short syntax for if-statements whenever possible
9293
- ireturn # Accept Interfaces, Return Concrete Types
9394
- lll # Reports long lines
9495
- maintidx # maintidx measures the maintainability index of each function.
9596
- makezero # Finds slice declarations with non-zero initial length
96-
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted
9797
- nakedret # Finds naked returns in functions greater than a specified function length
9898
- nestif # Reports deeply nested if statements
9999
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity

‎internal/net/buffer_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestBuffer(t *testing.T) {
125125
equalUDPAddr(t, addr, raddr)
126126

127127
// Until EOF.
128-
if _, _, err = buffer.ReadFrom(packet); !errors.Is(io.EOF, err) {
128+
if _, _, err = buffer.ReadFrom(packet); !errors.Is(err, io.EOF) {
129129
t.Fatalf("Unexpected err %v wanted io.EOF", err)
130130
}
131131
}
@@ -148,7 +148,7 @@ func TestShortBuffer(t *testing.T) {
148148
packet := make([]byte, 3)
149149
var raddr net.Addr
150150
n, raddr, err = buffer.ReadFrom(packet)
151-
if !errors.Is(io.ErrShortBuffer, err) {
151+
if !errors.Is(err, io.ErrShortBuffer) {
152152
t.Fatalf("Unexpected err %v wanted io.ErrShortBuffer", err)
153153
}
154154
equalUDPAddr(t, nil, raddr)
@@ -251,7 +251,7 @@ func TestBufferAsync(t *testing.T) {
251251
equalUDPAddr(t, addr, raddr)
252252

253253
_, _, readErr := buffer.ReadFrom(packet)
254-
if !errors.Is(io.EOF, readErr) {
254+
if !errors.Is(readErr, io.EOF) {
255255
done <- fmt.Sprintf("Unexpected err %v wanted io.EOF", readErr)
256256
} else {
257257
close(done)

‎pkg/crypto/ccm/ccm.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ func (c *ccm) Overhead() int { return int(c.M) }
7474
func (c *ccm) MaxLength() int { return maxlen(c.L, c.Overhead()) }
7575

7676
func maxlen(l uint8, tagsize int) int {
77-
max := (uint64(1) << (8 * l)) - 1
78-
if m64 := uint64(math.MaxInt64) - uint64(tagsize); l > 8 || max > m64 {
79-
max = m64 // The maximum lentgh on a 64bit arch
77+
mLen := (uint64(1) << (8 * l)) - 1
78+
if m64 := uint64(math.MaxInt64) - uint64(tagsize); l > 8 || mLen > m64 {
79+
mLen = m64 // The maximum lentgh on a 64bit arch
8080
}
81-
if max != uint64(int(max)) {
81+
if mLen != uint64(int(mLen)) {
8282
return math.MaxInt32 - tagsize // We have only 32bit int's
8383
}
84-
return int(max)
84+
return int(mLen)
8585
}
8686

8787
// MaxNonceLength returns the maximum nonce length for a given plaintext length.

0 commit comments

Comments
 (0)
Please sign in to comment.