frostfs-api-go/internal/rand.go
Leonard Lyubich d35e935a9d [#401] test: Randomize value for oneof field
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-05-30 22:02:58 +03:00

12 lines
204 B
Go

package internal
import (
"math/rand"
"time"
)
// RandUint32 returns random uint32 value [0, max).
func RandUint32(max uint32) uint32 {
rand.Seed(time.Now().UnixNano())
return rand.Uint32() % max
}