Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 524 Bytes

README.md

File metadata and controls

27 lines (22 loc) · 524 Bytes

Go library for weatherapi.com

Easy-to-use api weather.com

Installing

go get github.com/Bogdan-Torkhov/weatherapi-go

Using

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
}