generator: Fix initial payload generation #43
1 changed files with 6 additions and 2 deletions
|
@ -40,11 +40,15 @@ func NewGenerator(vu modules.VU, size int) Generator {
|
|||
if size <= 0 {
|
||||
panic("size should be positive")
|
||||
}
|
||||
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
buf := make([]byte, size+TailSize)
|
||||
r.Read(buf)
|
||||
return Generator{
|
||||
vu: vu,
|
||||
size: size,
|
||||
rand: rand.New(rand.NewSource(time.Now().UnixNano())),
|
||||
buf: make([]byte, size+TailSize),
|
||||
rand: r,
|
||||
buf: buf,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue