mirror of
https://github.com/xiaoqidun/tipdw.git
synced 2024-11-23 19:36:47 +08:00
feat(优化返回): 返回指针,用于区分空结构体
This commit is contained in:
parent
9bdad9dfc4
commit
a3fcbdea3a
4
tipdw.go
4
tipdw.go
@ -36,7 +36,7 @@ type Location struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// QueryIP 使用腾讯位置服务查询IP
|
// QueryIP 使用腾讯位置服务查询IP
|
||||||
func QueryIP(sk string, key string, ip string) (result Result, err error) {
|
func QueryIP(sk string, key string, ip string) (result *Result, err error) {
|
||||||
arg := &reqLBS{
|
arg := &reqLBS{
|
||||||
SK: sk,
|
SK: sk,
|
||||||
Path: "/ws/location/v1/ip",
|
Path: "/ws/location/v1/ip",
|
||||||
@ -67,6 +67,6 @@ func QueryIP(sk string, key string, ip string) (result Result, err error) {
|
|||||||
err = fmt.Errorf("resp code is %d, body is %s", bodyUnmarshal.Status, body)
|
err = fmt.Errorf("resp code is %d, body is %s", bodyUnmarshal.Status, body)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
result = bodyUnmarshal.Result
|
result = &bodyUnmarshal.Result
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user