updated types

This commit is contained in:
Paul Lecuq 2019-08-12 18:18:32 +02:00
parent 017ec0a38b
commit 0a64a2100a
2 changed files with 3 additions and 3 deletions

View File

@ -81,8 +81,8 @@ func FetchData(wc *WeatherConfig, city string) (Data, error) {
} }
d.Points = map[string]interface{}{"temperature": d.Main.Temperature, d.Points = map[string]interface{}{"temperature": d.Main.Temperature,
"humidity": float64(d.Main.Humidity), "humidity": d.Main.Humidity,
"pressure": float64(d.Main.Pressure)} "pressure": d.Main.Pressure}
return d, nil return d, nil
} }

View File

@ -18,7 +18,7 @@ type Data struct {
City string `json:"name"` City string `json:"name"`
Main struct { Main struct {
Temperature float64 `json:"temp"` Temperature float64 `json:"temp"`
Humidity float64 `json:"humidity"` Humidity int64 `json:"humidity"`
Pressure float64 `json:"pressure"` Pressure float64 `json:"pressure"`
} }
Points map[string]interface{} Points map[string]interface{}