-
Notifications
You must be signed in to change notification settings - Fork 1
Fix golangci-lint configuration #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
peczenyj
wants to merge
2
commits into
zsiec:main
Choose a base branch
from
peczenyj:fix-golangci-lint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
golangci-lint output on my machine, using latest version (1.64.8) internal/ingestion/resolution/h264_parser.go:164:4: ineffectual assignment to maxMatrices (ineffassign)
maxMatrices := 8
^
internal/ingestion/frame/bframe_reorderer.go:123:12: Error return value is not checked (errcheck)
frame := heap.Pop(&r.buffer).(*types.VideoFrame)
^
internal/ingestion/frame/bframe_reorderer.go:254:12: Error return value is not checked (errcheck)
frame := heap.Pop(&r.buffer).(*types.VideoFrame)
^
internal/ingestion/frame/bframe_reorderer.go:332:18: Error return value is not checked (errcheck)
*h = append(*h, x.(*types.VideoFrame))
^
internal/ingestion/frame/assembler_output_test.go:256:4: ineffectual assignment to err (ineffassign)
err = assembler.AddPacket(pkt) // This should succeed (buffer has room)
^
internal/ingestion/memory/controller.go:126:10: Error return value is not checked (errcheck)
return val.(*atomic.Int64)
^
internal/ingestion/memory/controller.go:135:10: Error return value is not checked (errcheck)
return val.(*atomic.Int64)
^
internal/ingestion/memory/controller.go:148:12: Error return value is not checked (errcheck)
usage := streamUsage.(*atomic.Int64)
^
internal/ingestion/memory/controller.go:176:12: Error return value is not checked (errcheck)
usage := streamUsage.(*atomic.Int64)
^
internal/ingestion/memory/controller.go:192:15: Error return value is not checked (errcheck)
streamID := key.(string)
^
internal/ingestion/memory/controller.go:193:12: Error return value is not checked (errcheck)
usage := value.(*atomic.Int64).Load()
^
internal/ingestion/memory/controller.go:225:15: Error return value is not checked (errcheck)
streamID := key.(string)
^
internal/ingestion/memory/controller.go:226:12: Error return value is not checked (errcheck)
usage := value.(*atomic.Int64).Load()
^
internal/ingestion/memory/controller.go:246:14: Error return value is not checked (errcheck)
usage := streamUsage.(*atomic.Int64).Load()
^
internal/ingestion/memory/controller.go:260:12: Error return value is not checked (errcheck)
usage := streamUsage.(*atomic.Int64)
^
internal/ingestion/recovery/recovery.go:345:18: Error return value is not checked (errcheck)
lastRecovery := h.lastRecoveryTime.Load().(time.Time)
^
internal/ingestion/recovery/recovery.go:376:9: Error return value is not checked (errcheck)
return h.state.Load().(RecoveryState)
^
internal/ingestion/recovery/recovery.go:398:18: Error return value is not checked (errcheck)
lastRecovery := h.lastRecoveryTime.Load().(time.Time)
^
internal/ingestion/recovery/smart_recovery.go:149:16: Error return value of `h.HandleError` is not checked (errcheck)
h.HandleError(ErrorTypeCorruption, "preemptive_recovery")
^
internal/ingestion/recovery/smart_recovery.go:479:16: Error return value of `h.HandleError` is not checked (errcheck)
h.HandleError(ErrorTypeTimeout, "keyframe_timeout")
^
internal/ingestion/types/parameter_cache.go:120:11: Error return value is not checked (errcheck)
item := oldest.Value.(*cacheItem)
^
internal/ingestion/types/parameter_cache.go:142:13: Error return value is not checked (errcheck)
item := elem.Value.(*cacheItem)
^
internal/ingestion/buffer/pool.go:42:10: Error return value is not checked (errcheck)
return buf.(*RingBuffer)
^
internal/ingestion/buffer/pool.go:52:10: Error return value is not checked (errcheck)
return buf.(*RingBuffer)
^
internal/ingestion/buffer/pool.go:100:13: Error return value is not checked (errcheck)
buffer := buf.(*RingBuffer)
^
internal/ingestion/buffer/pool.go:123:13: Error return value is not checked (errcheck)
buffer := value.(*RingBuffer)
^
internal/ingestion/backpressure/controller.go:160:2: ineffectual assignment to pressure (ineffassign)
pressure := currentPressure
^
internal/queue/hybrid_queue_recovery_test.go:337:3: ineffectual assignment to err (ineffassign)
err = q.Enqueue([]byte("should_fail"))
^
internal/ingestion/rtp/listener.go:202:29: Error return value of `l.rtpConn.SetReadDeadline` is not checked (errcheck)
l.rtpConn.SetReadDeadline(time.Now().Add(time.Second))
^
internal/ingestion/rtp/listener.go:423:30: Error return value of `l.rtcpConn.SetReadDeadline` is not checked (errcheck)
l.rtcpConn.SetReadDeadline(time.Now().Add(time.Second))
^
internal/ingestion/rtp/session.go:277:22: Error return value of `s.registry.Update` is not checked (errcheck)
s.registry.Update(s.ctx, stream)
^
internal/ingestion/rtp/session.go:575:28: Error return value of `s.registry.UpdateStatus` is not checked (errcheck)
s.registry.UpdateStatus(s.ctx, s.streamID, registry.StatusError)
^
internal/ingestion/rtp/session.go:615:28: Error return value of `s.registry.UpdateStatus` is not checked (errcheck)
s.registry.UpdateStatus(s.ctx, s.streamID, registry.StatusError)
^
internal/ingestion/rtp/session.go:641:23: Error return value of `s.registry.Update` is not checked (errcheck)
s.registry.Update(s.ctx, stream)
^
internal/ingestion/srt/connection.go:106:25: Error return value of `c.registry.Unregister` is not checked (errcheck)
c.registry.Unregister(context.Background(), c.streamID)
^
internal/ingestion/srt/listener.go:159:25: Error return value of `socket.SetRejectReason` is not checked (errcheck)
socket.SetRejectReason(RejectionReasonBadRequest)
^
internal/ingestion/srt/listener.go:169:25: Error return value of `socket.SetRejectReason` is not checked (errcheck)
socket.SetRejectReason(RejectionReasonResourceUnavailable)
^
internal/ingestion/srt/listener.go:179:25: Error return value of `socket.SetRejectReason` is not checked (errcheck)
socket.SetRejectReason(RejectionReasonResourceUnavailable)
^
internal/ingestion/srt/listener.go:275:15: Error return value is not checked (errcheck)
streamID := key.(string)
^
internal/ingestion/srt/listener.go:276:11: Error return value is not checked (errcheck)
conn := value.(*Connection)
^
tests/helpers.go:229:9: Error return value is not checked (errcheck)
return listener.Addr().(*net.TCPAddr).Port, nil
^
internal/ingestion/api_handlers_video.go:50:9: Error return value of `w.Write` is not checked (errcheck)
w.Write([]byte(header))
^
internal/ingestion/api_handlers_video.go:53:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(previewData)
^
internal/ingestion/api_handlers_video.go:436:12: Error return value of `w.Write` is not checked (errcheck)
w.Write(jpegData)
^
internal/ingestion/api_handlers_video.go:445:8: Error return value is not checked (errcheck)
len(sessionStats["sps_ids"].([]uint8)),
^
internal/ingestion/api_handlers_video.go:447:8: Error return value is not checked (errcheck)
len(sessionStats["pps_ids"].([]uint8)),
^
internal/ingestion/api_handlers_video.go:499:9: Error return value of `w.Write` is not checked (errcheck)
w.Write(jpegData)
^
internal/ingestion/api_handlers_video.go:547:13: Error return value is not checked (errcheck)
SPSIDs: sessionStats["sps_ids"].([]uint8),
^
internal/ingestion/api_handlers_video.go:548:13: Error return value is not checked (errcheck)
PPSIDs: sessionStats["pps_ids"].([]uint8),
^
internal/ingestion/manager.go:152:23: Error return value of `m.srtListener.Stop` is not checked (errcheck)
m.srtListener.Stop()
^
internal/ingestion/manager.go:594:15: Error return value of `handler.Stop` is not checked (errcheck)
handler.Stop()
^
internal/ingestion/manager.go:676:25: Error return value of `m.registry.Unregister` is not checked (errcheck)
m.registry.Unregister(context.Background(), streamID)
^
internal/ingestion/stream_handler.go:1383:32: Error return value of `h.recoveryHandler.HandleError` is not checked (errcheck)
h.recoveryHandler.HandleError(recovery.ErrorTypeSequenceGap, gap)
^
internal/ingestion/stream_handler.go:1399:32: Error return value of `h.recoveryHandler.HandleError` is not checked (errcheck)
h.recoveryHandler.HandleError(recovery.ErrorTypeTimestampJump, jump)
^
internal/ingestion/manager_test.go:409:2: ineffectual assignment to manager (ineffassign)
manager, mr := setupTestManager(t)
^
internal/ingestion/gop/buffer.go:242:11: Error return value is not checked (errcheck)
gop := front.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:259:9: Error return value is not checked (errcheck)
gop := front.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:281:18: Error return value is not checked (errcheck)
b.oldestTime = b.gops.Front().Value.(*types.GOP).StartTime
^
internal/ingestion/gop/buffer.go:299:10: Error return value is not checked (errcheck)
return elem.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:326:27: Error return value is not checked (errcheck)
result = append(result, elem.Value.(*types.GOP))
^
internal/ingestion/gop/buffer.go:389:10: Error return value is not checked (errcheck)
gop := elem.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:435:10: Error return value is not checked (errcheck)
gop := elem.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:476:10: Error return value is not checked (errcheck)
gop := front.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:533:10: Error return value is not checked (errcheck)
gop := elem.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:569:10: Error return value is not checked (errcheck)
gop := elem.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:621:10: Error return value is not checked (errcheck)
gop := elem.Value.(*types.GOP)
^
internal/ingestion/gop/buffer.go:743:9: Error return value is not checked (errcheck)
gop := elem.Value.(*types.GOP)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here I am assuming that we supposed to run golangci-lint version 1
If I try to run golangci-lint with current
.golangci.yml
file I got some warningsIf I try to validate the configuration with
golangci-lint config verify
I got:I try to fix the warnings and remove the invalid properties
I check with
yamllint
and the file is valid (remove some trailing spaces etc)now it is possible migrate to
golangci-lint
v2BTW it is important to know... there are several lint issues