mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
22 lines
391 B
Go
22 lines
391 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/kataras/iris/v12/_examples/http-client/weatherapi/client"
|
|
)
|
|
|
|
func main() {
|
|
c := client.NewClient(client.Options{
|
|
APIKey: "{YOUR_API_KEY_HERE}",
|
|
})
|
|
|
|
resp, err := c.GetCurrentByCity(context.Background(), "Xanthi/GR")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
fmt.Printf("Temp: %.2f(C), %.2f(F)\n", resp.Current.TempC, resp.Current.TempF)
|
|
}
|