http请求超时后,报空指针了,不知道什么问题
http的代码,超时以后,会在defer的部分报空指针,不知道哪里有问题了
client := &http.Client{
Timeout: 1 * time.Second,
}
response, errr := client.Do(request)
defer response.Body.Close()
if errr != nil {
dlog.Errorf("format of data is wrong||input=%+v||error=%+v\n", input, errj)
return -1, errr
}