chore: Rename
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
parent
29764bd79a
commit
5b8ba0122d
2 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ func New(siteName string) (*Met, error) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Met) Forecast(lat, lon float64, alt *int) (*LocationforecastResult, error) {
|
func (m *Met) Forecast(lat, lon float64, alt *int) (*LocationForecastResult, error) {
|
||||||
url := fmt.Sprintf("https://api.met.no/weatherapi/locationforecast/2.0/complete?lat=%.4f&lon=%.4f&altitude=%d", lat, lon, alt)
|
url := fmt.Sprintf("https://api.met.no/weatherapi/locationforecast/2.0/complete?lat=%.4f&lon=%.4f&altitude=%d", lat, lon, alt)
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
|
@ -45,7 +45,7 @@ func (m *Met) Forecast(lat, lon float64, alt *int) (*LocationforecastResult, err
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
forecast := LocationforecastResult{}
|
forecast := LocationForecastResult{}
|
||||||
err = json.Unmarshal(body, &forecast)
|
err = json.Unmarshal(body, &forecast)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -7,7 +7,7 @@ type cacheInfo struct {
|
||||||
LastModified time.Time `json:"lastModified"`
|
LastModified time.Time `json:"lastModified"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LocationforecastResult struct {
|
type LocationForecastResult struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
|
|
||||||
Geometry struct {
|
Geometry struct {
|
||||||
|
|
Loading…
Reference in a new issue