2 Commits

Author SHA1 Message Date
kor-elf eeba7ca661 Merge pull request 'v0.1.1' (#2) from develop into main
Reviewed-on: #2
2026-04-11 01:08:35 +05:00
kor-elf 8a32dfaff3 Merge pull request 'v0.1.0' (#1) from develop into main
Reviewed-on: #1
2026-04-09 22:15:30 +05:00
2 changed files with 3 additions and 3 deletions
+1 -2
View File
@@ -2,14 +2,13 @@ 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.
var ErrNotFound = errors.New("not found") const ErrNotFound = "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 {
+2 -1
View File
@@ -1,6 +1,7 @@
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"
@@ -46,7 +47,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{}, geoip2.ErrNotFound return geoip2.Info{}, errors.New(geoip2.ErrNotFound)
} }
var timeZone string var timeZone string