mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 20:20:05 +00:00
386b69f473
* fix incorrect exported name in comments * add comments to exported methods
28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
package testdata
|
|
|
|
import (
|
|
foobar "math/rand"
|
|
mathRand "math/rand"
|
|
"time"
|
|
)
|
|
|
|
// UseRandNewCustomImport --
|
|
func UseRandNewCustomImport() {
|
|
source := mathRand.NewSource(time.Now().UnixNano()) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/shared/rand"
|
|
randGenerator := mathRand.New(source) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/shared/rand"
|
|
start := uint64(randGenerator.Intn(32))
|
|
_ = start
|
|
|
|
source = mathRand.NewSource(time.Now().UnixNano()) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/shared/rand"
|
|
randGenerator = mathRand.New(source) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/shared/rand"
|
|
}
|
|
|
|
// UseWithoutSeeCustomImport --
|
|
func UseWithoutSeeCustomImport() {
|
|
assignedIndex := mathRand.Intn(128) // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/shared/rand"
|
|
_ = assignedIndex
|
|
foobar.Shuffle(10, func(i, j int) { // want "crypto-secure RNGs are required, use CSPRNG or PRNG defined in github.com/prysmaticlabs/prysm/shared/rand"
|
|
|
|
})
|
|
}
|