Files
services/examples/weather/now/go/getCurrentWeather.go
2021-09-16 12:52:36 +01:00

17 lines
385 B
Go
Executable File

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