Skip to content

Commit 125512b

Browse files
Merge branch 'master' into rob/jb_perf
2 parents 2de1b4e + 35f14ab commit 125512b

28 files changed

+683
-331
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
release:
2222
uses: pion/.goassets/.github/workflows/release.reusable.yml@master
2323
with:
24-
go-version: "1.24" # auto-update/latest-go-version
24+
go-version: "1.25" # auto-update/latest-go-version

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
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.24", "1.23"] # auto-update/supported-go-version-list
26+
go: ["1.25", "1.24"] # 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.24", "1.23"] # auto-update/supported-go-version-list
36+
go: ["1.25", "1.24"] # 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.24" # auto-update/latest-go-version
44+
go-version: "1.25" # auto-update/latest-go-version
4545
secrets: inherit

.github/workflows/tidy-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
tidy:
2323
uses: pion/.goassets/.github/workflows/tidy-check.reusable.yml@master
2424
with:
25-
go-version: "1.24" # auto-update/latest-go-version
25+
go-version: "1.25" # auto-update/latest-go-version

.golangci.yml

Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,7 @@
11
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
22
# SPDX-License-Identifier: MIT
33

4-
run:
5-
timeout: 5m
6-
7-
linters-settings:
8-
govet:
9-
enable:
10-
- shadow
11-
misspell:
12-
locale: US
13-
exhaustive:
14-
default-signifies-exhaustive: true
15-
gomodguard:
16-
blocked:
17-
modules:
18-
- github.com/pkg/errors:
19-
recommendations:
20-
- errors
21-
forbidigo:
22-
analyze-types: true
23-
forbid:
24-
- ^fmt.Print(f|ln)?$
25-
- ^log.(Panic|Fatal|Print)(f|ln)?$
26-
- ^os.Exit$
27-
- ^panic$
28-
- ^print(ln)?$
29-
- p: ^testing.T.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)$
30-
pkg: ^testing$
31-
msg: "use testify/assert instead"
32-
varnamelen:
33-
max-distance: 12
34-
min-name-length: 2
35-
ignore-type-assert-ok: true
36-
ignore-map-index-ok: true
37-
ignore-chan-recv-ok: true
38-
ignore-decls:
39-
- i int
40-
- n int
41-
- w io.Writer
42-
- r io.Reader
43-
- b []byte
44-
4+
version: "2"
455
linters:
466
enable:
477
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
@@ -60,25 +20,19 @@ linters:
6020
- errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.
6121
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
6222
- exhaustive # check exhaustiveness of enum switch statements
63-
- exportloopref # checks for pointers to enclosing loop variables
6423
- forbidigo # Forbids identifiers
6524
- forcetypeassert # finds forced type assertions
66-
- gci # Gci control golang package import order and make it always deterministic.
6725
- gochecknoglobals # Checks that no globals are present in Go code
6826
- gocognit # Computes and checks the cognitive complexity of functions
6927
- goconst # Finds repeated strings that could be replaced by a constant
7028
- gocritic # The most opinionated Go source code linter
7129
- gocyclo # Computes and checks the cyclomatic complexity of functions
7230
- godot # Check if comments end in a period
7331
- godox # Tool for detection of FIXME, TODO and other comment keywords
74-
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
75-
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
7632
- goheader # Checks is file header matches to pattern
77-
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
7833
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
7934
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
8035
- gosec # Inspects source code for security problems
81-
- gosimple # Linter for Go source code that specializes in simplifying a code
8236
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
8337
- grouper # An analyzer to analyze expression groups.
8438
- importas # Enforces consistent import aliases
@@ -96,11 +50,8 @@ linters:
9650
- predeclared # find code that shadows one of Go's predeclared identifiers
9751
- revive # golint replacement, finds style mistakes
9852
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
99-
- stylecheck # Stylecheck is a replacement for golint
10053
- tagliatelle # Checks the struct tags.
101-
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
10254
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
103-
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
10455
- unconvert # Remove unnecessary type conversions
10556
- unparam # Reports unused function parameters
10657
- unused # Checks Go code for unused constants, variables, functions and types
@@ -125,21 +76,72 @@ linters:
12576
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
12677
- wrapcheck # Checks that errors returned from external packages are wrapped
12778
- wsl # Whitespace Linter - Forces you to use empty lines!
128-
129-
issues:
130-
exclude-use-default: false
131-
exclude-dirs-use-default: false
132-
exclude-rules:
133-
# Allow complex tests and examples, better to be self contained
134-
- path: (examples|main\.go)
135-
linters:
136-
- gocognit
137-
- forbidigo
138-
- path: _test\.go
139-
linters:
140-
- gocognit
141-
142-
# Allow forbidden identifiers in CLI commands
143-
- path: cmd
144-
linters:
145-
- forbidigo
79+
settings:
80+
staticcheck:
81+
checks:
82+
- all
83+
- -QF1008 # "could remove embedded field", to keep it explicit!
84+
- -QF1003 # "could use tagged switch on enum", Cases conflicts with exhaustive!
85+
exhaustive:
86+
default-signifies-exhaustive: true
87+
forbidigo:
88+
forbid:
89+
- pattern: ^fmt.Print(f|ln)?$
90+
- pattern: ^log.(Panic|Fatal|Print)(f|ln)?$
91+
- pattern: ^os.Exit$
92+
- pattern: ^panic$
93+
- pattern: ^print(ln)?$
94+
- pattern: ^testing.T.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)$
95+
pkg: ^testing$
96+
msg: use testify/assert instead
97+
analyze-types: true
98+
gomodguard:
99+
blocked:
100+
modules:
101+
- github.com/pkg/errors:
102+
recommendations:
103+
- errors
104+
govet:
105+
enable:
106+
- shadow
107+
revive:
108+
rules:
109+
# Prefer 'any' type alias over 'interface{}' for Go 1.18+ compatibility
110+
- name: use-any
111+
severity: warning
112+
disabled: false
113+
misspell:
114+
locale: US
115+
varnamelen:
116+
max-distance: 12
117+
min-name-length: 2
118+
ignore-type-assert-ok: true
119+
ignore-map-index-ok: true
120+
ignore-chan-recv-ok: true
121+
ignore-decls:
122+
- i int
123+
- n int
124+
- w io.Writer
125+
- r io.Reader
126+
- b []byte
127+
exclusions:
128+
generated: lax
129+
rules:
130+
- linters:
131+
- forbidigo
132+
- gocognit
133+
path: (examples|main\.go)
134+
- linters:
135+
- gocognit
136+
path: _test\.go
137+
- linters:
138+
- forbidigo
139+
path: cmd
140+
formatters:
141+
enable:
142+
- gci # Gci control golang package import order and make it always deterministic.
143+
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
144+
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
145+
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
146+
exclusions:
147+
generated: lax

.reuse/dep5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
22
Upstream-Name: Pion
33
Source: https://github.com/pion/
44

5-
Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json sfu-ws/flutter/.gitignore sfu-ws/flutter/pubspec.yaml c-data-channels/webrtc.h examples/examples.json
5+
Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json sfu-ws/flutter/.gitignore sfu-ws/flutter/pubspec.yaml c-data-channels/webrtc.h examples/examples.json yarn.lock
66
Copyright: 2023 The Pion community <https://pion.ly>
77
License: MIT
88

attributes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ const (
2020
var errInvalidType = errors.New("found value of invalid type in attributes map")
2121

2222
// Attributes are a generic key/value store used by interceptors.
23-
type Attributes map[interface{}]interface{}
23+
type Attributes map[any]any
2424

2525
// Get returns the attribute associated with key.
26-
func (a Attributes) Get(key interface{}) interface{} {
26+
func (a Attributes) Get(key any) any {
2727
return a[key]
2828
}
2929

3030
// Set sets the attribute associated with key to the given value.
31-
func (a Attributes) Set(key interface{}, val interface{}) {
31+
func (a Attributes) Set(key any, val any) {
3232
a[key] = val
3333
}
3434

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module github.com/pion/interceptor
22

3-
go 1.20
3+
go 1.21
44

55
require (
6-
github.com/pion/logging v0.2.3
6+
github.com/pion/logging v0.2.4
77
github.com/pion/rtcp v1.2.15
8-
github.com/pion/rtp v1.8.18
8+
github.com/pion/rtp v1.8.21
99
github.com/pion/transport/v3 v3.0.7
10-
github.com/stretchr/testify v1.10.0
10+
github.com/stretchr/testify v1.11.1
1111
)
1212

1313
require (

go.sum

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
22
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3-
github.com/pion/logging v0.2.3 h1:gHuf0zpoh1GW67Nr6Gj4cv5Z9ZscU7g/EaoC/Ke/igI=
4-
github.com/pion/logging v0.2.3/go.mod h1:z8YfknkquMe1csOrxK5kc+5/ZPAzMxbKLX5aXpbpC90=
3+
github.com/pion/logging v0.2.4 h1:tTew+7cmQ+Mc1pTBLKH2puKsOvhm32dROumOZ655zB8=
4+
github.com/pion/logging v0.2.4/go.mod h1:DffhXTKYdNZU+KtJ5pyQDjvOAh/GsNSyv1lbkFbe3so=
55
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
66
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
77
github.com/pion/rtcp v1.2.15 h1:LZQi2JbdipLOj4eBjK4wlVoQWfrZbh3Q6eHtWtJBZBo=
88
github.com/pion/rtcp v1.2.15/go.mod h1:jlGuAjHMEXwMUHK78RgX0UmEJFV4zUKOFHR7OP+D3D0=
9-
github.com/pion/rtp v1.8.18 h1:yEAb4+4a8nkPCecWzQB6V/uEU18X1lQCGAQCjP+pyvU=
10-
github.com/pion/rtp v1.8.18/go.mod h1:bAu2UFKScgzyFqvUKmbvzSdPr+NGbZtv6UB2hesqXBk=
9+
github.com/pion/rtp v1.8.21 h1:3yrOwmZFyUpcIosNcWRpQaU+UXIJ6yxLuJ8Bx0mw37Y=
10+
github.com/pion/rtp v1.8.21/go.mod h1:bAu2UFKScgzyFqvUKmbvzSdPr+NGbZtv6UB2hesqXBk=
1111
github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0=
1212
github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo=
1313
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1414
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
15-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
16-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
15+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
16+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
1717
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
18+
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
1819
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1920
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2021
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

internal/rtpbuffer/packet_factory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ type PacketFactoryCopy struct {
3030
func NewPacketFactoryCopy() *PacketFactoryCopy {
3131
return &PacketFactoryCopy{
3232
headerPool: &sync.Pool{
33-
New: func() interface{} {
33+
New: func() any {
3434
return &rtp.Header{}
3535
},
3636
},
3737
payloadPool: &sync.Pool{
38-
New: func() interface{} {
38+
New: func() any {
3939
buf := make([]byte, maxPayloadLen)
4040

4141
return &buf

pkg/cc/interceptor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type BandwidthEstimator interface {
2525
WriteRTCP([]rtcp.Packet, interceptor.Attributes) error
2626
GetTargetBitrate() int
2727
OnTargetBitrateChange(f func(bitrate int))
28-
GetStats() map[string]interface{}
28+
GetStats() map[string]any
2929
Close() error
3030
}
3131

0 commit comments

Comments
 (0)