initial commit

This commit is contained in:
2026-07-23 23:25:26 +01:00
commit 6df41c1888
14 changed files with 765 additions and 0 deletions

30
kinds.go Normal file
View File

@@ -0,0 +1,30 @@
package lottery
import "fmt"
type Kind string
const (
KindLotto Kind = "lotto"
KindEuroMillions Kind = "euromillions"
KindSetForLife Kind = "setforlife"
KindThunderball Kind = "thunderball"
KindPowerball Kind = "powerball"
)
func ParseKind(kind string) (Kind, error) {
switch kind {
case "lotto":
return KindLotto, nil
case "euromillions":
return KindEuroMillions, nil
case "setforlife":
return KindSetForLife, nil
case "thunderball":
return KindThunderball, nil
case "powerball":
return KindPowerball, nil
default:
return "", fmt.Errorf("invalid lottery kind: %s", kind)
}
}