Files
m3o-go/examples/weather/now/getCurrentWeather.go
2021-10-29 10:44:29 +00:00

18 lines
358 B
Go
Executable File

package example
import (
"fmt"
"os"
"go.m3o.com/weather"
)
// Get the current weather report for a location by postcode, city, zip code, ip address
func GetCurrentWeather() {
weatherService := weather.NewWeatherService(os.Getenv("M3O_API_TOKEN"))
rsp, err := weatherService.Now(&weather.NowRequest{
Location: "london",
})
fmt.Println(rsp, err)
}