update golangci-lint (#3149)
This commit is contained in:
parent
29f0ded9f1
commit
c7dbb951f3
|
@ -15,6 +15,7 @@ linters:
|
|||
- nilerr
|
||||
- prealloc
|
||||
- revive
|
||||
- usestdlibvars
|
||||
- unconvert
|
||||
- tparallel
|
||||
- wastedassign
|
||||
|
|
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
BASE_IMAGE = golang:1.21-alpine3.19
|
||||
LINT_IMAGE = golangci/golangci-lint:v1.55.2
|
||||
LINT_IMAGE = golangci/golangci-lint:v1.56.2
|
||||
NODE_IMAGE = node:20-alpine3.19
|
||||
ALPINE_IMAGE = alpine:3.19
|
||||
RPI32_IMAGE = balenalib/raspberry-pi:bullseye-run-20230712
|
||||
|
|
|
@ -194,7 +194,7 @@ func FuzzLoad(f *testing.F) {
|
|||
f.Add("MYPREFIX_MYDURATION", "a")
|
||||
f.Add("MYPREFIX_MYDURATION_A", "a")
|
||||
|
||||
f.Fuzz(func(t *testing.T, key string, val string) {
|
||||
f.Fuzz(func(_ *testing.T, key string, val string) {
|
||||
env := map[string]string{
|
||||
key: val,
|
||||
}
|
||||
|
|
|
@ -650,12 +650,12 @@ func TestPathSourceRegexp(t *testing.T) {
|
|||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
},
|
||||
onSetup: func(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
onSetup: func(_ *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
},
|
||||
onPlay: func(ctx *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, error) {
|
||||
onPlay: func(_ *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, error) {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, nil
|
||||
|
|
|
@ -202,7 +202,7 @@ func TestH264EmptyPacket(t *testing.T) {
|
|||
}
|
||||
|
||||
func FuzzRTPH264ExtractParams(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
rtpH264ExtractParams(b)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ func TestH265EmptyPacket(t *testing.T) {
|
|||
}
|
||||
|
||||
func FuzzRTPH265ExtractParams(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
rtpH265ExtractParams(b)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -307,7 +307,7 @@ func FuzzUnmarshal(f *testing.F) {
|
|||
f.Add(ca.enc)
|
||||
}
|
||||
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
Unmarshal(b) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
|
|
@ -158,28 +158,28 @@ func TestChunkMarshal(t *testing.T) {
|
|||
}
|
||||
|
||||
func FuzzChunk0Read(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
var chunk Chunk0
|
||||
chunk.Read(bytes.NewReader(b), 65536, false) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzChunk1Read(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
var chunk Chunk1
|
||||
chunk.Read(bytes.NewReader(b), 65536, false) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzChunk2Read(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
var chunk Chunk2
|
||||
chunk.Read(bytes.NewReader(b), 65536, false) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzChunk3Read(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
var chunk Chunk3
|
||||
chunk.Read(bytes.NewReader(b), 65536, true) //nolint:errcheck
|
||||
})
|
||||
|
|
|
@ -297,7 +297,7 @@ func FuzzReader(f *testing.F) {
|
|||
0x01, 0x00, 0x00, 0x00, 0x88, 0x68, 0x76, 0x63,
|
||||
0x31, 0x01, 0x02, 0x03,
|
||||
})
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
bc := bytecounter.NewReader(bytes.NewReader(b))
|
||||
r := NewReader(bc, bc, nil)
|
||||
r.Read() //nolint:errcheck
|
||||
|
|
|
@ -205,7 +205,7 @@ func TestReader(t *testing.T) {
|
|||
t.Run(ca.name, func(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
br := bytecounter.NewReader(&buf)
|
||||
r := NewReader(br, br, func(count uint32) error {
|
||||
r := NewReader(br, br, func(_ uint32) error {
|
||||
return nil
|
||||
})
|
||||
|
||||
|
@ -234,7 +234,7 @@ func TestReaderAcknowledge(t *testing.T) {
|
|||
|
||||
var buf bytes.Buffer
|
||||
bc := bytecounter.NewReader(&buf)
|
||||
r := NewReader(bc, bc, func(count uint32) error {
|
||||
r := NewReader(bc, bc, func(_ uint32) error {
|
||||
close(onAckCalled)
|
||||
return nil
|
||||
})
|
||||
|
@ -269,9 +269,9 @@ func TestReaderAcknowledge(t *testing.T) {
|
|||
}
|
||||
|
||||
func FuzzReader(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
br := bytecounter.NewReader(bytes.NewReader(b))
|
||||
r := NewReader(br, br, func(count uint32) error {
|
||||
r := NewReader(br, br, func(_ uint32) error {
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ var (
|
|||
)
|
||||
|
||||
var upgrader = websocket.Upgrader{
|
||||
CheckOrigin: func(r *http.Request) bool {
|
||||
CheckOrigin: func(_ *http.Request) bool {
|
||||
return true
|
||||
},
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ func TestServerConn(t *testing.T) {
|
|||
defer res.Body.Close()
|
||||
defer c.Close() //nolint:errcheck
|
||||
|
||||
c.SetPingHandler(func(msg string) error {
|
||||
c.SetPingHandler(func(_ string) error {
|
||||
close(pingReceived)
|
||||
return nil
|
||||
})
|
||||
|
|
|
@ -167,10 +167,10 @@ func TestAgent(t *testing.T) {
|
|||
SegmentDuration: 1 * time.Second,
|
||||
PathName: "mypath",
|
||||
Stream: stream,
|
||||
OnSegmentCreate: func(fpath string) {
|
||||
OnSegmentCreate: func(_ string) {
|
||||
segCreated <- struct{}{}
|
||||
},
|
||||
OnSegmentComplete: func(fpath string) {
|
||||
OnSegmentComplete: func(_ string) {
|
||||
segDone <- struct{}{}
|
||||
},
|
||||
Parent: &test.NilLogger{},
|
||||
|
|
|
@ -258,7 +258,7 @@ func TestServerRead(t *testing.T) {
|
|||
},
|
||||
})
|
||||
|
||||
r.OnDataH264(func(pts time.Duration, au [][]byte) {
|
||||
r.OnDataH264(func(_ time.Duration, au [][]byte) {
|
||||
require.Equal(t, [][]byte{
|
||||
test.FormatH264.SPS,
|
||||
test.FormatH264.PPS,
|
||||
|
|
|
@ -228,7 +228,7 @@ func TestServerRead(t *testing.T) {
|
|||
|
||||
recv := make(chan struct{})
|
||||
|
||||
reader.OnPacketRTPAny(func(m *description.Media, f format.Format, p *rtp.Packet) {
|
||||
reader.OnPacketRTPAny(func(_ *description.Media, _ format.Format, p *rtp.Packet) {
|
||||
require.Equal(t, &rtp.Packet{
|
||||
Header: rtp.Header{
|
||||
Version: 2,
|
||||
|
|
|
@ -123,7 +123,7 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error {
|
|||
}},
|
||||
}
|
||||
|
||||
c.OnDataH26x(track, func(pts time.Duration, dts time.Duration, au [][]byte) {
|
||||
c.OnDataH26x(track, func(pts time.Duration, _ time.Duration, au [][]byte) {
|
||||
stream.WriteUnit(medi, medi.Formats[0], &unit.H264{
|
||||
Base: unit.Base{
|
||||
NTP: time.Now(),
|
||||
|
@ -144,7 +144,7 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error {
|
|||
}},
|
||||
}
|
||||
|
||||
c.OnDataH26x(track, func(pts time.Duration, dts time.Duration, au [][]byte) {
|
||||
c.OnDataH26x(track, func(pts time.Duration, _ time.Duration, au [][]byte) {
|
||||
stream.WriteUnit(medi, medi.Formats[0], &unit.H265{
|
||||
Base: unit.Base{
|
||||
NTP: time.Now(),
|
||||
|
|
|
@ -69,12 +69,12 @@ func TestSource(t *testing.T) {
|
|||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
},
|
||||
onSetup: func(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
onSetup: func(_ *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
},
|
||||
onPlay: func(ctx *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, error) {
|
||||
onPlay: func(_ *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, error) {
|
||||
go func() {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
err := stream.WritePacketRTP(media0, &rtp.Packet{
|
||||
|
@ -195,7 +195,7 @@ func TestRTSPSourceNoPassword(t *testing.T) {
|
|||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
},
|
||||
onSetup: func(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
onSetup: func(_ *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
go func() {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
err := stream.WritePacketRTP(media0, &rtp.Packet{
|
||||
|
@ -216,7 +216,7 @@ func TestRTSPSourceNoPassword(t *testing.T) {
|
|||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
},
|
||||
onPlay: func(ctx *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, error) {
|
||||
onPlay: func(_ *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, error) {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, nil
|
||||
|
@ -263,12 +263,12 @@ func TestRTSPSourceRange(t *testing.T) {
|
|||
|
||||
s := gortsplib.Server{
|
||||
Handler: &testServer{
|
||||
onDescribe: func(ctx *gortsplib.ServerHandlerOnDescribeCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
onDescribe: func(_ *gortsplib.ServerHandlerOnDescribeCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
},
|
||||
onSetup: func(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
onSetup: func(_ *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusOK,
|
||||
}, stream, nil
|
||||
|
|
Loading…
Reference in New Issue