Files
m3o-go/examples/weather/forecast/forecastWeather/main.go
2021-12-09 15:06:12 +00:00

19 lines
329 B
Go
Executable File

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