I am new to Go ( and programming to an extent), so using a learn as you practice approach.
For the code below ( which pulls weather forecast ), I am looking to populate the longitude and latitude from a list I have.
I am not entirely sure how to setup that list in the first place - use structs and then pipe the value of the stored struct into this code? I tried that and it seems I can only hold one lon/lat pair in a struct. I was thinking of using maps but couldn't figure out how to set it all up. Perhaps, I should store the list of values in a text file and read from there:
p := Place{
placeName: "Accra", lat: "43.6595", long: "-79.3433",
placeName: "Kumasi", lat: "43.6595", long: "-79.3433",
placeName: "Tamale", lat: "43.6595", long: "-79.3433",
}
f, err := forecast.Get(key, p.lat, p.long, "now", forecast.CA)
if err != nil {
log.Fatal(err)
}
the struct looked like this ( I have about 10 separate long/lat values to use)
type Place struct {
placeName string
lat string
long string
}