File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,21 @@ var err error
3131currentWeather, err = owm.CurrentWeatherFromCoordinates (lat, long)
3232```
3333
34+ If fetching the weather from a city ID, pass the city ID as an argument to the CurrentWeatherFromCityID function
35+ ``` go
36+ var currentWeather *openweathermap.CurrentWeatherResponse
37+ var err error
38+
39+ currentWeather, err = owm.CurrentWeatherFromCityID (id)
40+ ```
41+
42+ If fetching the weather from a zip code, pass the zip code as an argument to the CurrentWeatherFromZip function
43+ ``` go
44+ var currentWeather *openweathermap.CurrentWeatherResponse
45+ var err error
46+
47+ currentWeather, err = owm.CurrentWeatherFromZip (zip)
48+ ```
3449
3550This function returns a struct, (CurrentWeatherResonse) that matches the fields of the json response from the API
3651``` json
You can’t perform that action at this time.
0 commit comments