diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6b38fc09..5f7f364f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - uses: golangci/golangci-lint-action@v3 with: - version: v1.52.2 + version: v1.53.3 mod-tidy: runs-on: ubuntu-22.04 diff --git a/.golangci.yml b/.golangci.yml index 45f0aaa3..dadbd3f6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,11 +7,13 @@ linters: - gocritic - gofmt - gofumpt - - misspell - lll + - misspell + - nilerr - prealloc - revive - unconvert + - wastedassign - whitespace disable: - errcheck diff --git a/Makefile b/Makefile index fdc9ddc5..ed137847 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BASE_IMAGE = golang:1.20-alpine3.17 -LINT_IMAGE = golangci/golangci-lint:v1.52.2 +LINT_IMAGE = golangci/golangci-lint:v1.53.3 NODE_IMAGE = node:16-alpine3.17 ALPINE_IMAGE = alpine:3.17 RPI32_IMAGE = balenalib/raspberry-pi:bullseye-run diff --git a/internal/core/rtsp_source_test.go b/internal/core/rtsp_source_test.go index 2231e946..0032470c 100644 --- a/internal/core/rtsp_source_test.go +++ b/internal/core/rtsp_source_test.go @@ -51,7 +51,7 @@ func TestRTSPSource(t *testing.T) { ) (*base.Response, *gortsplib.ServerStream, error) { err := auth.Validate(ctx.Request, "testuser", "testpass", nil, nil, "IPCAM", nonce) if err != nil { - return &base.Response{ + return &base.Response{ //nolint:nilerr StatusCode: base.StatusUnauthorized, Header: base.Header{ "WWW-Authenticate": auth.GenerateWWWAuthenticate(nil, "IPCAM", nonce), @@ -175,7 +175,7 @@ func TestRTSPSourceNoPassword(t *testing.T) { onDescribe: func(ctx *gortsplib.ServerHandlerOnDescribeCtx) (*base.Response, *gortsplib.ServerStream, error) { err := auth.Validate(ctx.Request, "testuser", "", nil, nil, "IPCAM", nonce) if err != nil { - return &base.Response{ + return &base.Response{ //nolint:nilerr StatusCode: base.StatusUnauthorized, Header: base.Header{ "WWW-Authenticate": auth.GenerateWWWAuthenticate(nil, "IPCAM", nonce), diff --git a/internal/core/webrtc_outgoing_track.go b/internal/core/webrtc_outgoing_track.go index ef004eb6..e8fd9493 100644 --- a/internal/core/webrtc_outgoing_track.go +++ b/internal/core/webrtc_outgoing_track.go @@ -61,7 +61,7 @@ func newWebRTCOutgoingTrackVideo(medias media.Medias) (*webRTCOutgoingTrack, err packets, err := encoder.Encode(tunit.OBUs, tunit.PTS) if err != nil { - return nil + return nil //nolint:nilerr } for _, pkt := range packets { @@ -108,7 +108,7 @@ func newWebRTCOutgoingTrackVideo(medias media.Medias) (*webRTCOutgoingTrack, err packets, err := encoder.Encode(tunit.Frame, tunit.PTS) if err != nil { - return nil + return nil //nolint:nilerr } for _, pkt := range packets { @@ -155,7 +155,7 @@ func newWebRTCOutgoingTrackVideo(medias media.Medias) (*webRTCOutgoingTrack, err packets, err := encoder.Encode(tunit.Frame, tunit.PTS) if err != nil { - return nil + return nil //nolint:nilerr } for _, pkt := range packets { @@ -215,7 +215,7 @@ func newWebRTCOutgoingTrackVideo(medias media.Medias) (*webRTCOutgoingTrack, err packets, err := encoder.Encode(tunit.AU, tunit.PTS) if err != nil { - return nil + return nil //nolint:nilerr } for _, pkt := range packets {