NewRandSource is copied from Sobek's source code: https://github.com/grafana/sobek/blob/master/sobek/main.go#L44 The returned RandSource is NOT safe for concurrent use: https://golang.org/pkg/math/rand/#NewSource
()
| 14 | // The returned RandSource is NOT safe for concurrent use: |
| 15 | // https://golang.org/pkg/math/rand/#NewSource |
| 16 | func NewRandSource() sobek.RandSource { |
| 17 | var seed int64 |
| 18 | if err := binary.Read(crand.Reader, binary.LittleEndian, &seed); err != nil { |
| 19 | panic(fmt.Errorf("could not read random bytes: %w", err)) |
| 20 | } |
| 21 | return rand.New(rand.NewSource(seed)).Float64 //nolint:gosec |
| 22 | } |
no test coverage detected
searching dependent graphs…