Skip to content

Commit

Permalink
FIX: nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
myzhan committed Jan 22, 2020
1 parent 64df95e commit 7b0060a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ type runner struct {
closeChan chan bool

outputs []Output

randSrc *rand.Rand
}

// safeRun runs fn and recovers from unexpected panics.
Expand Down Expand Up @@ -181,7 +179,8 @@ func (r *runner) getRandomTask() *Task {
return nil
}

randNum := r.randSrc.Intn(totalWeight)
rs := rand.New(rand.NewSource(time.Now().UnixNano()))
randNum := rs.Intn(totalWeight)

runningSum := 0
for _, task := range r.tasks {
Expand Down

0 comments on commit 7b0060a

Please sign in to comment.