Files
m3o-go/examples/weather/now/getCurrentWeather/main.go
2021-11-03 15:36:34 +00:00

19 lines
343 B
Go
Executable File

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