use "#nosec" instead of "nolint:gosec" to be more specific

The `#nosec` comment allows ignoring a specific rule; this prevents
potentially other "gosec" linting failulres from being silently ignored.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-07-03 13:31:06 +02:00
parent 5da2ff5990
commit fd87647da1
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ func (pc *RandomPodChooser) ChoosePod(ctx context.Context) (*corev1.Pod, error)
if randSource == nil {
randSource = rand.NewSource(time.Now().Unix())
}
rnd := rand.New(randSource) //nolint:gosec // no strong seeding required
rnd := rand.New(randSource) // #nosec G404 -- no strong seeding required
n := rnd.Int() % len(pods)
logrus.Debugf("RandomPodChooser.ChoosePod(): len(pods)=%d, n=%d", len(pods), n)
return pods[n], nil