go get github.com/Bogdan-Torkhov/weatherapi-go
package main
import (
"fmt"
"github.com/Bogdan-Torkhov/weatherapi-go/weather"
)
func main() {
const yourAPIkey = "apiKeyHere"
w, err := weather.GetWeather(yourAPIkey, "London") // Api key, location
if err != nil {
panic(err)
}
fmt.Println(w) // All weather
fmt.Println(w.GetMain()) // Only main weather
fmt.Println(w.Current.Condition.Text) // Output: sunny
}