Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b1bb2f9412 | |||
|
9e0c065ecc
|
@@ -2,13 +2,14 @@ package geoip2
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrNotFound is returned when the database does not contain the IP address.
|
// 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.
|
// Info is a structure that contains information about the IP address.
|
||||||
type Info struct {
|
type Info struct {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package mmdb
|
package mmdb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
|
||||||
"git.kor-elf.net/kor-elf-shield/geoip2"
|
"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
|
return geoip2.Info{}, err
|
||||||
}
|
}
|
||||||
if !record.HasData() {
|
if !record.HasData() {
|
||||||
return geoip2.Info{}, errors.New(geoip2.ErrNotFound)
|
return geoip2.Info{}, geoip2.ErrNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
var timeZone string
|
var timeZone string
|
||||||
|
|||||||
Reference in New Issue
Block a user