okospaceapi/pkg/location/wheel_of_fortune.go

21 lines
399 B
Go
Raw Normal View History

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]
}