geoip2-golang icon indicating copy to clipboard operation
geoip2-golang copied to clipboard

Initialize location coordinates to NaN before lookup.

Open nickbruun opened this issue 10 years ago • 1 comments
trafficstars

It's useful to have a semantic concept of location coordinates not being available when using the result of a lookup. Currently, a lookup resulting in no location will return a coordinate set of (0, 0). While this coordinate is in the Gulf of Guinea and thus could be argued to be a good "zero value" but (NaN, NaN) seems cleaner to me. Thoughts?

By the way, awesome work on the reader and lookup implementation!

nickbruun avatar Feb 23 '15 22:02 nickbruun

Thanks. I think this might make sense. I need to think about it a bit more as it may be a breaking change for some people.

oschwald avatar Feb 24 '15 02:02 oschwald