update golangci-lint

This commit is contained in:
aler9 2021-10-30 13:06:29 +02:00
parent a83f57bc3e
commit c9c9c88ac8
9 changed files with 5 additions and 12 deletions

View File

@ -15,7 +15,7 @@ jobs:
- uses: golangci/golangci-lint-action@v2
with:
version: v1.38
version: v1.40
mod-tidy:
runs-on: ubuntu-20.04

View File

@ -2,6 +2,7 @@
linters:
enable:
- bodyclose
- dupl
- exportloopref
- gochecknoinits
- gocritic
@ -12,6 +13,7 @@ linters:
- lll
- prealloc
- unconvert
- whitespace
disable:
- errcheck

View File

@ -1,6 +1,6 @@
BASE_IMAGE = golang:1.16-alpine3.13
LINT_IMAGE = golangci/golangci-lint:v1.38.0
LINT_IMAGE = golangci/golangci-lint:v1.40
NODE_IMAGE = node:14-alpine3.13
.PHONY: $(shell ls)
@ -43,7 +43,7 @@ export DOCKERFILE_FORMAT
format:
echo "$$DOCKERFILE_FORMAT" | docker build -q . -f - -t temp
docker run --rm -it -v $(PWD):/s -w /s temp \
sh -c "find . -type f -name '*.go' | xargs gofumpt -l -w"
sh -c "gofumpt -l -w ."
define DOCKERFILE_TEST
ARG ARCH

View File

@ -189,7 +189,6 @@ func (pconf *PathConf) checkAndFillMissing(name string) error {
if err != nil {
return fmt.Errorf("'%s': %s", pconf.Fallback, err)
}
} else {
_, err := base.ParseURL(pconf.Fallback)
if err != nil {

View File

@ -280,7 +280,6 @@ func (r *hlsMuxer) runInner(innerCtx context.Context, innerReady chan struct{})
videoTrackID = i
h264Decoder = rtph264.NewDecoder()
} else if t.IsAAC() {
if audioTrack != nil {
return fmt.Errorf("can't read track %d with HLS: too many tracks", i+1)
@ -351,7 +350,6 @@ func (r *hlsMuxer) runInner(innerCtx context.Context, innerReady chan struct{})
if err != nil {
return err
}
} else if audioTrack != nil && pair.trackID == audioTrackID {
var pkt rtp.Packet
err := pkt.Unmarshal(pair.buf)

View File

@ -474,7 +474,6 @@ func (pa *path) onDemandStartSource() {
if pa.hasStaticSource() {
pa.staticSourceCreate()
pa.onDemandReadyTimer = time.NewTimer(time.Duration(pa.conf.SourceOnDemandStartTimeout))
} else {
pa.log(logger.Info, "runOnDemand command started")
_, port, _ := net.SplitHostPort(pa.rtspAddress)

View File

@ -251,7 +251,6 @@ func (c *rtmpConn) runRead(ctx context.Context) error {
videoTrack = t
videoTrackID = i
h264Decoder = rtph264.NewDecoder()
} else if t.IsAAC() {
if audioTrack != nil {
return fmt.Errorf("can't read track %d with RTMP: too many tracks", i+1)
@ -377,7 +376,6 @@ func (c *rtmpConn) runRead(ctx context.Context) error {
if err != nil {
return err
}
} else if audioTrack != nil && pair.trackID == audioTrackID {
var pkt rtp.Packet
err := pkt.Unmarshal(pair.buf)

View File

@ -59,7 +59,6 @@ func TestRTSPServerPublishRead(t *testing.T) {
"readTimeout: 20s\n")
require.Equal(t, true, ok)
defer p.close()
} else {
proto = "rtsps"
port = "8555"
@ -262,7 +261,6 @@ func TestRTSPServerAuth(t *testing.T) {
require.NoError(t, err)
defer cnt2.close()
require.Equal(t, 0, cnt2.wait())
} else {
cnt2, err := newContainer("vlc", "dest", []string{
"rtsp://testuser:test!$()*+.;<=>[]^_-{}@localhost:8554/test/stream",

View File

@ -885,7 +885,6 @@ func (c *Client) processSegment(innerCtx context.Context, byts []byte) error {
dts -= c.clockStartPTS
c.videoProc.process(data.PES.Data, pts, dts)
} else if c.audioPID != nil && data.PID == *c.audioPID {
pts -= c.clockStartPTS