Fixed typos in docs

This commit is contained in:
2025-06-23 05:40:20 +02:00
parent a987c0fb34
commit 82f67515e7
7 changed files with 44 additions and 40 deletions

View File

@@ -12,8 +12,7 @@ type ForecastEntity struct {
Wind Wind `json:"wind"`
}
// The Forecast data type, representing the an set
// of ForecastEntity
// The Forecast data type, representing a set of ForecastEntity
type Forecast struct {
Forecast []ForecastEntity
Forecast []ForecastEntity `json:"forecast"`
}

View File

@@ -18,7 +18,7 @@ func InitDB() *StatDB {
}
func (statDB *StatDB) AddStatistic(cityName string, weather Weather) {
key := fmt.Sprintf("%s@%s", weather.Date.Date, cityName)
key := fmt.Sprintf("%s@%s", weather.Date.Date.Format("2006-01-02"), cityName)
// Insert weather statistic into the database only if it isn't present
if _, isPresent := statDB.db[key]; isPresent {