Skip to content
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

Fix gosec lint errors #777

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/router/app/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ func (d *Router) Start() {
v1Buf := diodes.NewManyToOneEnvelope(d.c.IngressBufferSize, gendiodes.AlertFunc(func(missed int) {
log.Printf("Dropped %d envelopes (v1 buffer)", missed)

ingressDropped.Increment(uint64(missed))
ingressDropped.Increment(uint64(missed)) // nolint:gosec
}))

v2Buf := diodes.NewManyToOneEnvelopeV2(d.c.IngressBufferSize, gendiodes.AlertFunc(func(missed int) {
log.Printf("Dropped %d envelopes (v2 buffer)", missed)

ingressDropped.Increment(uint64(missed))
ingressDropped.Increment(uint64(missed)) // nolint:gosec
}))

// metric-documentation-v2: (loggregator.doppler.subscriptions) Number of
Expand Down
2 changes: 1 addition & 1 deletion src/router/internal/server/v1/doppler_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (m *DopplerServer) sendBatchData(req *plumbing.SubscriptionRequest, sender

// Alert logs dropped message counts to stderr.
func (m *DopplerServer) Alert(missed int) {
m.egressDropped.Increment(uint64(missed))
m.egressDropped.Increment(uint64(missed)) // nolint:gosec
}

func (m *DopplerServer) monitorContext(ctx context.Context, done *int64) {
Expand Down
2 changes: 1 addition & 1 deletion src/router/internal/server/v2/egress_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewEgressServer(

// Alert logs dropped message counts to stderr.
func (s *EgressServer) Alert(missed int) {
s.droppedMetric.Increment(uint64(missed))
s.droppedMetric.Increment(uint64(missed)) // nolint:gosec
}

// Receiver implements loggregator_v2.EgressServer.
Expand Down
Loading