Add test for geo model

This commit is contained in:
2021-12-01 16:57:41 +01:00
parent ac32dc240f
commit f7d0a679c9
2 changed files with 79 additions and 4 deletions

View File

@ -73,8 +73,7 @@ func CloseDBs() {
// LookUp an IP and get city data
func (record *GeoRecord) LookUp(ip net.IP) error {
err := db.city.Lookup(ip, record)
if err != nil {
if err := db.city.Lookup(ip, record); err != nil {
return err
}
@ -83,8 +82,7 @@ func (record *GeoRecord) LookUp(ip net.IP) error {
// LookUp an IP and get ASN data
func (record *ASNRecord) LookUp(ip net.IP) error {
err := db.asn.Lookup(ip, record)
if err != nil {
if err := db.asn.Lookup(ip, record); err != nil {
return err
}