Well a timeout of 10 something is a good idea indeed...

This commit is contained in:
xenolf 2016-07-21 03:27:34 +02:00
parent 082ff6d029
commit 029ece0fd2

View file

@ -8,13 +8,14 @@ import (
"net/http" "net/http"
"runtime" "runtime"
"strings" "strings"
"time"
) )
// UserAgent (if non-empty) will be tacked onto the User-Agent string in requests. // UserAgent (if non-empty) will be tacked onto the User-Agent string in requests.
var UserAgent string var UserAgent string
// HTTPClient is an HTTP client with a reasonable timeout value. // HTTPClient is an HTTP client with a reasonable timeout value.
var HTTPClient = http.Client{Timeout: 10} var HTTPClient = http.Client{Timeout: 10 * time.Second}
const ( const (
// defaultGoUserAgent is the Go HTTP package user agent string. Too // defaultGoUserAgent is the Go HTTP package user agent string. Too