updated types
This commit is contained in:
parent
017ec0a38b
commit
0a64a2100a
@ -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
|
||||||
}
|
}
|
||||||
|
2
types.go
2
types.go
@ -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{}
|
||||||
|
Loading…
Reference in New Issue
Block a user