Skip to content

Commit

Permalink
add random.Pick to simplify the selection of random element from an…
Browse files Browse the repository at this point in the history
… enum list
  • Loading branch information
adamluzsi committed Jan 16, 2024
1 parent 1f01e36 commit ba50aff
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 50 deletions.
3 changes: 3 additions & 0 deletions random/Factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type (
)

func (f *Factory) Make(rnd *Random, T any) (_T any) {
if rnd == nil {
rnd = defaultRandom
}
if T == nil {
return nil
}
Expand Down
Loading

0 comments on commit ba50aff

Please sign in to comment.