diff --git a/toxics/slicer.go b/toxics/slicer.go index 8b54ecc6..1ba2a27d 100644 --- a/toxics/slicer.go +++ b/toxics/slicer.go @@ -38,9 +38,9 @@ func (t *SlicerToxic) chunk(start int, end int) []int { } mid := start + (end-start)/2 - // #nosec G404 -- was ignored before too + if t.SizeVariation > 0 { - mid += rand.Intn(t.SizeVariation*2) - t.SizeVariation + mid += rand.Intn(t.SizeVariation*2) - t.SizeVariation // #nosec G404 -- was ignored before too } left := t.chunk(start, mid) right := t.chunk(mid, end) diff --git a/toxics/toxic.go b/toxics/toxic.go index 9f90b7bd..36fc660b 100644 --- a/toxics/toxic.go +++ b/toxics/toxic.go @@ -81,8 +81,7 @@ func NewToxicStub(input <-chan *stream.StreamChunk, output chan<- *stream.Stream func (s *ToxicStub) Run(toxic *ToxicWrapper) { s.running = make(chan struct{}) defer close(s.running) - // #nosec G404 -- was ignored before too - if rand.Float32() < toxic.Toxicity { + if rand.Float32() < toxic.Toxicity { // #nosec G404 -- was ignored before too toxic.Pipe(s) } else { new(NoopToxic).Pipe(s)