geo-golang
geo-golang copied to clipboard
Geocode should not return a nil location and a nil error
I just checked the openstreetmap response parser, and when the returned longitude and latitude are empty, it returns nil for both location and error.
Returning nil
as a valid value when there is no error is undesirable. It means that we have to check the return value, regardless of whether we have a return error or not.
Instead, it would probably be good to return a sentinel error, such as ErrNoCoordsFound
.