Files
m3o-go/examples/weather/forecast/forecastWeather.go
2021-10-29 10:44:29 +00:00

19 lines
343 B
Go
Executable File

package example
import (
"fmt"
"os"
"go.m3o.com/weather"
)
// Get the weather forecast for the next 1-10 days
func ForecastWeather() {
weatherService := weather.NewWeatherService(os.Getenv("M3O_API_TOKEN"))
rsp, err := weatherService.Forecast(&weather.ForecastRequest{
Days: 2,
Location: "London",
})
fmt.Println(rsp, err)
}