From f1106d1072aeaf806cceffab73d38e0f62f06d44 Mon Sep 17 00:00:00 2001 From: Ivan Protsiuk Date: Wed, 21 Aug 2024 20:52:25 +0000 Subject: [PATCH] ignore linter warnings for g115 rule Signed-off-by: Andrew Costa --- src/plumbing/envelope_averager.go | 4 ++-- src/rlp-gateway/internal/metrics/metrics.go | 2 +- src/router/app/router.go | 2 +- src/router/internal/server/v1/doppler_server.go | 2 +- src/router/internal/server/v2/egress_server.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plumbing/envelope_averager.go b/src/plumbing/envelope_averager.go index 6782a4b55..87a734a5b 100644 --- a/src/plumbing/envelope_averager.go +++ b/src/plumbing/envelope_averager.go @@ -27,7 +27,7 @@ func NewEnvelopeAverager() *EnvelopeAverager { func (a *EnvelopeAverager) Track(count, size int) { for { current := atomic.LoadUint64((*uint64)(&a.storage)) - newValue := countAndTotal(current).encodeDelta(uint16(count), uint64(size)) + newValue := countAndTotal(current).encodeDelta(uint16(count), uint64(size)) //#nosec G115 if atomic.CompareAndSwapUint64((*uint64)(&a.storage), current, uint64(newValue)) { return @@ -77,7 +77,7 @@ func (u countAndTotal) encodeDelta(count uint16, total uint64) countAndTotal { } func (u countAndTotal) decode() (count uint16, total uint64) { - count = uint16((uint64(u) & 0xFFFF000000000000) >> 48) + count = uint16((uint64(u) & 0xFFFF000000000000) >> 48) //#nosec G115 total = (uint64(u) & 0x0000FFFFFFFFFFFF) return count, total } diff --git a/src/rlp-gateway/internal/metrics/metrics.go b/src/rlp-gateway/internal/metrics/metrics.go index b55318310..af6e7c90e 100644 --- a/src/rlp-gateway/internal/metrics/metrics.go +++ b/src/rlp-gateway/internal/metrics/metrics.go @@ -37,7 +37,7 @@ func (m *Metrics) NewCounter(name string) func(delta uint64) { i := m.m.Get(name).(*expvar.Int) return func(d uint64) { - i.Add(int64(d)) + i.Add(int64(d)) //#nosec G115 } } diff --git a/src/router/app/router.go b/src/router/app/router.go index e039cbc43..e2a15ff04 100644 --- a/src/router/app/router.go +++ b/src/router/app/router.go @@ -235,7 +235,7 @@ func initV2Metrics(c *Config) *metricemitter.Client { log.Fatalf("Could not use GRPC creds for server: %s", err) } - batchInterval := time.Duration(c.MetricBatchIntervalMilliseconds) * time.Millisecond + batchInterval := time.Duration(c.MetricBatchIntervalMilliseconds) * time.Millisecond //#nosec G115 // metric-documentation-v2: setup function metricClient, err := metricemitter.NewClient( diff --git a/src/router/internal/server/v1/doppler_server.go b/src/router/internal/server/v1/doppler_server.go index 0afd13b9a..3175d0eeb 100644 --- a/src/router/internal/server/v1/doppler_server.go +++ b/src/router/internal/server/v1/doppler_server.go @@ -151,7 +151,7 @@ func (m *DopplerServer) sendBatchData(req *plumbing.SubscriptionRequest, sender errStream := make(chan error, 1) batcher := batching.NewByteBatcher( - int(m.batchSize), + int(m.batchSize), //#nosec G115 m.batchInterval, &batchWriter{ sender: sender, diff --git a/src/router/internal/server/v2/egress_server.go b/src/router/internal/server/v2/egress_server.go index 103fa0559..8608b35b5 100644 --- a/src/router/internal/server/v2/egress_server.go +++ b/src/router/internal/server/v2/egress_server.go @@ -95,7 +95,7 @@ func (s *EgressServer) BatchedReceiver( errStream := make(chan error, 1) batcher := batching.NewV2EnvelopeBatcher( - int(s.batchSize), + int(s.batchSize), //#nosec G115 s.batchInterval, &batchWriter{ sender: sender,