This commit is contained in:
Martin Polden
2018-02-11 11:19:50 +01:00
parent 5d43f175d4
commit d49f1f7376
4 changed files with 22 additions and 38 deletions

View File

@ -22,14 +22,6 @@ type geoip struct {
city *geoip2.Reader
}
type empty struct{}
func (d *empty) Country(ip net.IP) (Country, error) { return Country{}, nil }
func (d *empty) City(ip net.IP) (string, error) { return "", nil }
func (d *empty) IsEmpty() bool { return true }
func Empty() Client { return &empty{} }
func New(countryDB, cityDB string) (Client, error) {
var country, city *geoip2.Reader
if countryDB != "" {