b97a5e415a
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
21 lines
287 B
Go
21 lines
287 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.sr.ht/~timharek/yr-go"
|
|
)
|
|
|
|
func main() {
|
|
y, err := yr.New()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
now, err := y.Now("bergen")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
fmt.Printf("Temp: %.4f\n", now.Temperature)
|
|
fmt.Printf("Rain: %.4f\n", now.Percipitation)
|
|
}
|