this is my actual code :
func cURL(cURL string, follow bool) (*string, error) {
var err error
var resp *http.Response
var req *http.Request
var u *url.URL
if u, err = url.Parse(cURL); nil != err {
if logLevel >= 30 {
log.Print("ERROR: ", err)
}
return nil, err
}
if req, err = http.NewRequest("GET", u.Scheme+"://"+u.Host+u.Path, nil); err != nil {
if logLevel >= 40 {
log.Print("ERROR: ", err)
}
return nil, err
}
req.URL.RawQuery = u.RawQuery
client := &http.Client{
Timeout: 3 * time.Second, //timeout connexion
}
if resp, err = client.Do(req); nil != err {
if logLevel >= 50 {
log.Print("ERROR: ", err)
}
return nil, err
}
defer resp.Body.Close()
var body []byte
if body, err = ioutil.ReadAll(resp.Body); nil != err {
if logLevel >= 30 {
log.Print("ERROR: ", err)
}
return nil, err
}
var html string
html = string(body)
return &html, nil
}
same time print this error in terminal, i want to hide this :
2017/09/29 18:19:28 Unsolicited response received on idle HTTP channel starting with "HTTP/1.0 408 Request Time-out\r\nServer: AkamaiGHost\r\nMime-Version: 1.0\r\nDate: Fri, 29 Sep 2017 16:18:21 GMT\r\nContent-Type: text/html\r\nContent-Length: 218\r\nExpires: Fri, 29 Sep 2017 16:18:21 GMT\r\n\r\n<HTML><HEAD>\n<TITLE>Request Timeout</TITLE>\n</HEAD><BODY>\n<H1>Request Timeout</H1>\nThe server timed out while waiting for the browser's request.<P>\nReference 
i want to hide this error, not print in terminal, how i can do this ? Where im wrong ? i use this function for check large list urls if have specific keyword, the list is really big 50 milions urls.