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, err = GetLocationForIp("114.114.114.114") if err == nil { fmt.Println(geo) } else { fmt.Println("GetLocationForIp:", err) } }