Merge pull request 'v0.1.2' (#3) from develop into main

Reviewed-on: #3
This commit is contained in:
2026-04-11 17:25:01 +05:00
2 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -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 -2
View File
@@ -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