Skip to content

Commit

Permalink
Abstracting it to a variable to verify if nosec comment applies.
Browse files Browse the repository at this point in the history
  • Loading branch information
dianadevasia committed Mar 12, 2024
1 parent 1453dac commit 385ab37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toxics/toxic.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ 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 {
randomToxicity := rand.Float32() // #nosec G404 -- was ignored before too
if randomToxicity < toxic.Toxicity {
toxic.Pipe(s)
} else {
new(NoopToxic).Pipe(s)
Expand Down

0 comments on commit 385ab37

Please sign in to comment.