1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| package iploc
|
| import (
| "fmt"
| "testing"
| )
|
| func Test_GetLocation(t *testing.T) {
| geo, err := GetLocation()
| if err == nil {
| fmt.Println(geo)
| } else {
| fmt.Println("GetLocation:", err)
| }
|
| geo, _ = GetLocationForIp("114.114.114.114")
| if err == nil {
| fmt.Println(geo)
| } else {
| fmt.Println("GetLocationForIp:", err)
| }
| }
|
|