2020-06-26 14:58:47 +00:00
package testdata
import (
foobar "math/rand"
mathRand "math/rand"
"time"
)
2021-04-23 12:06:05 +00:00
// UseRandNewCustomImport --
2020-06-26 14:58:47 +00:00
func UseRandNewCustomImport ( ) {
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
source := mathRand . NewSource ( time . Now ( ) . UnixNano ( ) ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
randGenerator := mathRand . New ( source ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2020-06-26 14:58:47 +00:00
start := uint64 ( randGenerator . Intn ( 32 ) )
_ = start
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
source = mathRand . NewSource ( time . Now ( ) . UnixNano ( ) ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
randGenerator = mathRand . New ( source ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2020-06-26 14:58:47 +00:00
}
2021-04-23 12:06:05 +00:00
// UseWithoutSeeCustomImport --
func UseWithoutSeeCustomImport ( ) {
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
assignedIndex := mathRand . Intn ( 128 ) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2020-06-26 14:58:47 +00:00
_ = assignedIndex
2021-08-15 15:24:13 +00:00
// #nosec G404
2021-09-15 22:55:11 +00:00
foobar . Shuffle ( 10 , func ( i , j int ) { // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/crypto/rand"
2020-06-26 14:58:47 +00:00
} )
}