Merge pull request 'v0.1.2' (#3) from develop into main
Reviewed-on: #3
This commit is contained in:
@@ -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,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
|
||||
|
||||
Reference in New Issue
Block a user