Skip to content

Commit 752e442

Browse files
pionbotSean-Der
authored andcommitted
Update CI configs to v0.11.15
Update lint scripts and CI configs.
1 parent d54f787 commit 752e442

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

Diff for: .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

Diff for: .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

Diff for: datachannel_go_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ func TestDataChannel_MessagesAreOrdered(t *testing.T) {
7373
api := NewAPI()
7474
dc := &DataChannel{api: api}
7575

76-
max := 512
76+
maxVal := 512
7777
out := make(chan int)
7878
inner := func(msg DataChannelMessage) {
7979
// randomly sleep
8080
// math/rand a weak RNG, but this does not need to be secure. Ignore with #nosec
8181
/* #nosec */
82-
randInt, err := rand.Int(rand.Reader, big.NewInt(int64(max)))
82+
randInt, err := rand.Int(rand.Reader, big.NewInt(int64(maxVal)))
8383
/* #nosec */ if err != nil {
8484
t.Fatalf("Failed to get random sleep duration: %s", err)
8585
}
@@ -92,7 +92,7 @@ func TestDataChannel_MessagesAreOrdered(t *testing.T) {
9292
})
9393

9494
go func() {
95-
for i := 1; i <= max; i++ {
95+
for i := 1; i <= maxVal; i++ {
9696
buf := make([]byte, 8)
9797
binary.PutVarint(buf, int64(i))
9898
dc.onMessage(DataChannelMessage{Data: buf})
@@ -107,16 +107,16 @@ func TestDataChannel_MessagesAreOrdered(t *testing.T) {
107107
}
108108
}()
109109

110-
values := make([]int, 0, max)
110+
values := make([]int, 0, maxVal)
111111
for v := range out {
112112
values = append(values, v)
113-
if len(values) == max {
113+
if len(values) == maxVal {
114114
close(out)
115115
}
116116
}
117117

118-
expected := make([]int, max)
119-
for i := 1; i <= max; i++ {
118+
expected := make([]int, maxVal)
119+
for i := 1; i <= maxVal; i++ {
120120
expected[i-1] = i
121121
}
122122
assert.EqualValues(t, expected, values)

Diff for: examples/ice-tcp/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func doSignaling(w http.ResponseWriter, r *http.Request) {
3838
d.OnOpen(func() {
3939
for range time.Tick(time.Second * 3) {
4040
if err = d.SendText(time.Now().String()); err != nil {
41-
if errors.Is(io.ErrClosedPipe, err) {
41+
if errors.Is(err, io.ErrClosedPipe) {
4242
return
4343
}
4444
panic(err)

Diff for: examples/ortc-media/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func writeFileToTrack(ivf *ivfreader.IVFReader, header *ivfreader.IVFFileHeader,
228228
frame, _, err := ivf.ParseNextFrame()
229229
if errors.Is(err, io.EOF) {
230230
fmt.Printf("All video frames parsed and sent")
231-
os.Exit(0)
231+
os.Exit(0) //nolint: gocritic
232232
}
233233

234234
if err != nil {

Diff for: peerconnection_close_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func TestPeerConnection_GracefulCloseWhileOpening(t *testing.T) {
259259
t.Fatal(err)
260260
}
261261

262-
if _, err := pcOffer.CreateDataChannel("initial_data_channel", nil); err != nil {
262+
if _, err = pcOffer.CreateDataChannel("initial_data_channel", nil); err != nil {
263263
t.Fatal(err)
264264
}
265265

Diff for: rtpsender_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func Test_RTPSender_ReplaceTrack(t *testing.T) {
5151
for {
5252
pkt, _, err := track.ReadRTP()
5353
if err != nil {
54-
assert.True(t, errors.Is(io.EOF, err))
54+
assert.True(t, errors.Is(err, io.EOF))
5555
return
5656
}
5757

Diff for: sctptransport.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,12 @@ func (r *SCTPTransport) generateAndSetDataChannelID(dtlsRole DTLSRole, idOut **u
423423
id++
424424
}
425425

426-
max := r.MaxChannels()
426+
maxVal := r.MaxChannels()
427427

428428
r.lock.Lock()
429429
defer r.lock.Unlock()
430430

431-
for ; id < max-1; id += 2 {
431+
for ; id < maxVal-1; id += 2 {
432432
if _, ok := r.dataChannelIDsUsed[id]; ok {
433433
continue
434434
}

0 commit comments

Comments
 (0)