oschwald / maxminddb-golang

MaxMind DB Reader for Go
ISC License
615 stars 101 forks source link

Return error if the entry is not found in the db. #16

Closed saich closed 9 years ago

saich commented 9 years ago

This will make the library users to easily identify when there is no data available for the given IP address.

Without passing this error, it makes it hard to identify if the passed record is filled by Lookup or not.

oschwald commented 9 years ago

I am not opposed to a change along these lines. In fact, I am not sure why I didn't do it in the first place. However, it is a breaking API change as implemented, and I am trying to maintain complete compatibility as this API has quite a few users. Also, there should probably be a new error type for the error to make it easier to distinguish it from other errors.

saich commented 9 years ago

Yes, I'd love to see something along those lines in the future versions. I closed it since the tests weren't handled properly which I figured after opening the pull requests.

@oschwald: Thanks for sharing your opinion. :)

sundarv85 commented 9 years ago

+1