weightedrand icon indicating copy to clipboard operation
weightedrand copied to clipboard

:balance_scale: Fast weighted random selection for Go

Results 7 weightedrand issues
Sort by recently updated
recently updated
newest added

This will improve the ergonomics of this library since we currently use an `interface{}` container type. However, that will require go1.18+, which will be a breaking change, thus the plan...

Key breaking changes would include (TBD list in progress): - [ ] Migration to rely upon `math/rand/v2`, exposing a different surface area for custom randomness sources (see #29) Non-breaking changes:...

Wouldn't it make more sense to use a `uint64` for the `total` and `max` fields inside the chooser? As it stands you allow the user to use a `uint64` for...

I _do_ want to set my seed, unrelated to lock contention. I want consistent reproduction of my random results with the same seed. Seeding global rand is deprecated (for good...

Since Go v1.22, they added a new version of the rand package (more details in [this post](https://go.dev/blog/randv2)) that should be faster if nothing else. It would be nice to see...

https://github.com/mroth/weightedrand/blob/82b9ec74aca51314533f5ad81822c7b722021e58/weightedrand.go#L41-L44 Sort doesn't make any sense for randomness. And it will change the order of the original array, which is not a good practice.

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.5.0 to 6.1.0. Release notes Sourced from actions/setup-go's releases. v6.1.0 What's Changed Enhancements Fall back to downloading from go.dev/dl instead of storage.googleapis.com/golang by @​nicholasngai in actions/setup-go#665 Add...

dependencies
github_actions