2 Commits

2 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -2,13 +2,14 @@ package geoip2
import (
"context"
"errors"
"fmt"
"net/netip"
"strings"
)
// ErrNotFound is returned when the database does not contain the IP address.
const ErrNotFound = "not found"
var ErrNotFound = errors.New("not found")
// Info is a structure that contains information about the IP address.
type Info struct {
+1 -2
View File
@@ -1,7 +1,6 @@
package mmdb
import (
"errors"
"net/netip"
"git.kor-elf.net/kor-elf-shield/geoip2"
@@ -47,7 +46,7 @@ func (c *City) infoCity(ip netip.Addr, reader *oschwaldGeoip2.Reader) (geoip2.In
return geoip2.Info{}, err
}
if !record.HasData() {
return geoip2.Info{}, errors.New(geoip2.ErrNotFound)
return geoip2.Info{}, geoip2.ErrNotFound
}
var timeZone string