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 == "" {
|
||||
ip, _, _ = net.SplitHostPort(request.RemoteAddr)
|
||||
}
|
||||
write := &resp{}
|
||||
response := &resp{}
|
||||
location, err := qqwry.QueryIP(ip)
|
||||
if err != nil {
|
||||
write.Message = err.Error()
|
||||
response.Message = err.Error()
|
||||
} else {
|
||||
write.Data = location
|
||||
write.Success = true
|
||||
response.Data = location
|
||||
response.Success = true
|
||||
}
|
||||
b, _ := json.MarshalIndent(write, "", " ")
|
||||
b, _ := json.MarshalIndent(response, "", " ")
|
||||
_, _ = writer.Write(b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user