evanoberholster / timezoneLookup

Timezone lookup API for GPS Coordinates based from GeoJSON
MIT License
47 stars 12 forks source link

Invert iter test in geo/latlng #13

Closed arkie closed 1 year ago

arkie commented 2 years ago

Test query for San Fransisco, United States (Etc/GMT+8)

Noticed that San Francisco was coming up an hour off in a separate project (and then the above line in the README): it should be America/Los_Angeles instead (https://time.is/San_Francisco), I think?

Adding a log to https://github.com/evanoberholster/timezoneLookup/blob/master/timezone.go#L72 showed that the iteration was continuing passed the initial match, so I tried inverting the check which seems like it passes the added tests, but didn't verify further.

Tests require presence of the timezone.data file, but I'm assuming you didn't want those checked in (and it seemed questionable to always download and rebuild); a minimal test case could probably be build up by adding the zones in code, but that seemed beyond the scope of this PR.

Feel free to remove the test file or otherwise alter. Thanks!