30 lines
409 B
Go
30 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)
|
||
|
}
|