geoip2-golang
geoip2-golang copied to clipboard
*Reader.City returns the zero value if not found
trafficstars
Hello,
The methods City() and Country should return nil if it finds nothing.
The current behavior is that is returns the zero value: https://github.com/oschwald/geoip2-golang/blob/master/reader.go#L240.
In this case, we have to check if city.GeonameID == 0 to know that it is not found.
Wouldn't it be better to return nil instead ?
This would be a breaking change. I would recommend using maxminddb directly if you want more control over this.