mirror of
https://github.com/skidoodle/ipinfo.git
synced 2025-02-15 08:29:17 +01:00
test updates
This commit is contained in:
parent
7e14ec4d76
commit
d4ac1c0dd8
5 changed files with 10 additions and 5 deletions
|
@ -114,6 +114,7 @@ func lookupIPData(ip net.IP) *dataStruct {
|
|||
Location struct {
|
||||
Latitude float64 `maxminddb:"latitude"`
|
||||
Longitude float64 `maxminddb:"longitude"`
|
||||
Timezone string `maxminddb:"time_zone"`
|
||||
} `maxminddb:"location"`
|
||||
}
|
||||
err := cityDB.Lookup(ip, &cityRecord)
|
||||
|
@ -152,6 +153,7 @@ func lookupIPData(ip net.IP) *dataStruct {
|
|||
Region: sd,
|
||||
Country: toPtr(cityRecord.Country.Names["en"]),
|
||||
Continent: toPtr(cityRecord.Continent.Names["en"]),
|
||||
Timezone: toPtr(cityRecord.Location.Timezone),
|
||||
Loc: toPtr(fmt.Sprintf("%.4f,%.4f", cityRecord.Location.Latitude, cityRecord.Location.Longitude)),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue