briandowns/openweathermap

*byzip should not use int as datatype

Opened this issue · 1 comments

The ByZip functions require an int as argument, this is an issue with German zip codes since they can start with a 0, for example Chemnitz (Saxony) has the zip acode 09123

Examples of functions affected:

  • func (w *CurrentWeatherData) CurrentByZip(zip int, countryCode string) error (current.go)
  • func (f *ForecastWeatherData) DailyByZip(zip int, countryCode string, days int) (forecast.go)

I suggest passing this as string

United States zip codes can start with a 0 as well. I came here to open an issue, but you beat me to it by two days.

Zip codes around Atlantic City for instance:

image