A simple Go package for generating unique random numbers, similar to a lottery draw.
lotery/lotery.go: Contains the main logic for generating random numbers.
Import the package and use the Generate function to get n unique random numbers between 1 and max (inclusive):
import "github.com/alshiryaev/goltr/lotery"
numbers := lotery.Generate(6, 24) // Generates 6 unique numbers between 1 and 24- Go version: 1.24.4
- To run or test, use standard Go commands:
go run ./lotery
go test