mirror of
https://github.com/xiaoqidun/qqwry.git
synced 2025-12-09 01:12:55 +08:00
style(代码风格): 调整代码风格
This commit is contained in:
@@ -33,14 +33,14 @@ func IpAPI(writer http.ResponseWriter, request *http.Request) {
|
|||||||
if ip == "" {
|
if ip == "" {
|
||||||
ip, _, _ = net.SplitHostPort(request.RemoteAddr)
|
ip, _, _ = net.SplitHostPort(request.RemoteAddr)
|
||||||
}
|
}
|
||||||
write := &resp{}
|
response := &resp{}
|
||||||
location, err := qqwry.QueryIP(ip)
|
location, err := qqwry.QueryIP(ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
write.Message = err.Error()
|
response.Message = err.Error()
|
||||||
} else {
|
} else {
|
||||||
write.Data = location
|
response.Data = location
|
||||||
write.Success = true
|
response.Success = true
|
||||||
}
|
}
|
||||||
b, _ := json.MarshalIndent(write, "", " ")
|
b, _ := json.MarshalIndent(response, "", " ")
|
||||||
_, _ = writer.Write(b)
|
_, _ = writer.Write(b)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user