Skip to content

Commit

Permalink
added description
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCrazyGM committed Dec 18, 2024
1 parent b7acbeb commit 4a06378
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions weather.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type WeatherData struct {
Temp float64 `json:"temp"`
} `json:"main"`
Weather []struct {
Main string `json:"main"`
Description string `json:"description"`
} `json:"weather"`
}

Expand All @@ -36,7 +36,7 @@ func getWeather(apiKey, city, units string) (float64, string, error) {

status := ""
if len(data.Weather) > 0 {
status = data.Weather[0].Main
status = data.Weather[0].Description
}

return data.Main.Temp, status, nil
Expand Down

0 comments on commit 4a06378

Please sign in to comment.