Skip to content

Commit d6a9e5f

Browse files
committed
math/rand/v2
1 parent 15f3bb3 commit d6a9e5f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/auth/recordingmetadata/recordingmetadatav1/recordingmetadata.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"context"
2424
"io"
2525
"log/slog"
26-
"math/rand"
26+
"math/rand/v2"
2727
"time"
2828

2929
"github.com/gravitational/trace"
@@ -405,7 +405,7 @@ func getRandomThumbnailIndex(interval time.Duration, duration time.Duration) int
405405
}
406406

407407
if numIntervals < 5 {
408-
return rand.Intn(numIntervals)
408+
return rand.IntN(numIntervals)
409409
}
410410

411411
startIndex := int(float64(numIntervals) * 0.2)
@@ -415,7 +415,7 @@ func getRandomThumbnailIndex(interval time.Duration, duration time.Duration) int
415415
}
416416

417417
rangeSize := endIndex - startIndex
418-
randomOffset := rand.Intn(rangeSize)
418+
randomOffset := rand.IntN(rangeSize)
419419
return startIndex + randomOffset
420420
}
421421

0 commit comments

Comments
 (0)