yr/cmd/yr.go
Tim Hårek Andreassen b97a5e415a
feat: Add yr package
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
2024-09-26 10:07:10 +02:00

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)
}