diff --git a/pkg/getter/httpgetter.go b/pkg/getter/httpgetter.go index 695a87743..3b4913780 100644 --- a/pkg/getter/httpgetter.go +++ b/pkg/getter/httpgetter.go @@ -18,6 +18,7 @@ package getter import ( "bytes" "crypto/tls" + "fmt" "io" "net/http" @@ -67,7 +68,10 @@ func (g *HTTPGetter) get(href string) (*bytes.Buffer, error) { resp, err := client.Do(req) if err != nil { - return buf, err + // In Go 1.14, the error returned from client.Do changed. + // This is for backward compatibility, so that tests will pass + // for Go 1.13 and before as well as 1.14 and beyond. + return buf, fmt.Errorf("Get %s: %s", href, err) } if resp.StatusCode != 200 { return buf, errors.Errorf("failed to fetch %s : %s", href, resp.Status)