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

Geocode should not return a nil location and a nil error

Open awfm9 opened this issue 5 years ago • 0 comments

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.

awfm9 avatar Jul 02 '19 12:07 awfm9