7866a4e087
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
29 lines
409 B
Go
29 lines
409 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
"git.sr.ht/~timharek/yr-go/internal/met"
|
|
)
|
|
|
|
func main() {
|
|
m, err := met.New("git.sr.ht/~timharek/yr-go")
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
|
|
forecast, err := m.Forecast(60.389444, 5.33, nil)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
|
|
f, err := json.Marshal(forecast)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
fmt.Printf("%s", f)
|
|
}
|