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
}
有疑问加站长微信联系(非本文作者)