|
|
|
|
388
|
func fetchURL(source string, timeout time.Duration) (io.ReadCloser, error) {
|
388
|
func fetchURL(source string, timeout time.Duration) (io.ReadCloser, error) {
|
389
|
resp, err := httpGet(source, timeout)
|
389
|
resp, err := httpGet(source, timeout)
|
390
|
if err != nil {
|
390
|
if err != nil {
|
391
|
- return nil, fmt.Errorf("http fetch %s: %v", source, err)
|
|
|
|
|
391
|
+ return nil, fmt.Errorf("http fetch: %v", err)
|
392
|
}
|
392
|
}
|
393
|
if resp.StatusCode != http.StatusOK {
|
393
|
if resp.StatusCode != http.StatusOK {
|
394
|
return nil, fmt.Errorf("server response: %s", resp.Status)
|
394
|
return nil, fmt.Errorf("server response: %s", resp.Status)
|