zhangzengfei
2022-01-19 d2f7c463c2f97b46b45692771a9f2e8f0e73b251
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)
    }
}