okospaceapi/pkg/location/wheel_of_fortune.go
Aaron Fischer 162d1cc00c
All checks were successful
/ docker-image (push) Successful in 1m30s
/ deployment (push) Successful in 0s
Add a wheel of fortune and fix json errors
2024-01-24 11:45:19 +01:00

20 lines
399 B
Go

package location
import "math/rand"
type Place struct {
Latitude float64
Longitude float64
Name string
}
func SpinThatWheel() Place {
// Cool places to be in Germany :)
places := []Place{
{Latitude: 48.858370, Longitude: 2.294481, Name: "Eifeltower"},
{Latitude: 27.987850, Longitude: 86.925026, Name: "Mount Everest"},
}
pick := rand.Int() % len(places)
return places[pick]
}