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

ignore linter warnings for g115 rule #768

Merged
merged 1 commit into from
Aug 21, 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/plumbing/envelope_averager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion src/rlp-gateway/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/router/app/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
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 @@ -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,
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 @@ -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,
Expand Down
Loading