dadata/geoip_test.go
Alexander Zhuravlev 24f5420d67 Example name fixed.
2019-04-08 14:55:04 +03:00

24 lines
473 B
Go

package dadata
import (
"fmt"
)
func ExampleClient_GeoIP() {
daData := NewClient()
geoIPResponse, err := daData.GeoIP("83.220.54.223")
if nil != err {
fmt.Println(err)
return
}
if geoIPResponse.Location == nil {
fmt.Println("empty result from GeoIP")
return
}
address := geoIPResponse.Location.Data
fmt.Println(address.Country)
fmt.Println(address.City)
fmt.Printf("see on https://www.google.com/maps/@%s,%sf,14z\n", address.GeoLat, address.GeoLon)
}