mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-13 03:05:32 +00:00
19 lines
343 B
Go
Executable File
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)
|
|
}
|