chore: Rename

Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
Tim Hårek Andreassen 2024-09-24 22:08:36 +02:00
parent 29764bd79a
commit 5b8ba0122d
No known key found for this signature in database
GPG key ID: E59C7734F0E10EB5
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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 {