feat(优化代码): 返回结构体而不是指针,添加在线演示地址

This commit is contained in:
xiaoqidun 2021-09-30 11:08:35 +08:00
parent a3fcbdea3a
commit 2a2830c4a6
2 changed files with 6 additions and 2 deletions

@ -2,6 +2,10 @@
Golang 腾讯IP定位库 Golang 腾讯IP定位库
# 在线演示
- [https://aite.xyz/tipdw](https://aite.xyz/tipdw)
# 接口文档 # 接口文档
- [https://lbs.qq.com/FAQ/server_faq.html](https://lbs.qq.com/FAQ/server_faq.html) - [https://lbs.qq.com/FAQ/server_faq.html](https://lbs.qq.com/FAQ/server_faq.html)

@ -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
} }