Pallinder/go-randomdata

the func of Number exists a bug!

474420502 opened this issue · 3 comments

panic: runtime error: index out of range

goroutine 28 [running]:
math/rand.(*rngSource).Uint64(...)
/usr/local/share/go/src/math/rand/rng.go:249
math/rand.(*rngSource).Int63(0xc0000c9500, 0x4f95066a366ef45d)
/usr/local/share/go/src/math/rand/rng.go:234 +0x89
math/rand.(*Rand).Int63(0xc0000aa4e0, 0x7ffffffe78bb7a00)
/usr/local/share/go/src/math/rand/rand.go:85 +0x33
math/rand.(*Rand).Int31(0xc0000aa4e0, 0x1e)
/usr/local/share/go/src/math/rand/rand.go:99 +0x2b
math/rand.(*Rand).Int31n(0xc0000aa4e0, 0xe0000001e, 0x0)
/usr/local/share/go/src/math/rand/rand.go:134 +0x4f
math/rand.(*Rand).Intn(0xc0000aa4e0, 0x1e, 0x14d)
/usr/local/share/go/src/math/rand/rand.go:172 +0x45
github.com/Pallinder/go-randomdata.Number(0xc000297ea8, 0x2, 0x2, 0x1e)
/usr/local/share/gopath/src/github.com/Pallinder/go-randomdata/random_data.go:225 +0x83
github.com/Pallinder/go-randomdata.FullDate(0x411703e3289fc8f6, 0x45)
/usr/local/share/gopath/src/github.com/Pallinder/go-randomdata/random_data.go:358 +0x10d

run test in go multi thread!

Can you still reproduce this with the latest version?

@Pallinder sorry, I forget this case. I have no problem that test again with simple example.