Commit 35030a99 authored by Amir Mohammad Saied's avatar Amir Mohammad Saied Committed by Brad Fitzpatrick

cmd/go: httpGet function does not use global variable httpClient

No change, just for consistency.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6346048
parent f06b12f0
...@@ -20,9 +20,13 @@ import ( ...@@ -20,9 +20,13 @@ import (
"net/url" "net/url"
) )
// httpClient is the default HTTP client, but a variable so it can be
// changed by tests, without modifying http.DefaultClient.
var httpClient = http.DefaultClient
// httpGET returns the data from an HTTP GET request for the given URL. // httpGET returns the data from an HTTP GET request for the given URL.
func httpGET(url string) ([]byte, error) { func httpGET(url string) ([]byte, error) {
resp, err := http.Get(url) resp, err := httpClient.Get(url)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -37,10 +41,6 @@ func httpGET(url string) ([]byte, error) { ...@@ -37,10 +41,6 @@ func httpGET(url string) ([]byte, error) {
return b, nil return b, nil
} }
// httpClient is the default HTTP client, but a variable so it can be
// changed by tests, without modifying http.DefaultClient.
var httpClient = http.DefaultClient
// httpsOrHTTP returns the body of either the importPath's // httpsOrHTTP returns the body of either the importPath's
// https resource or, if unavailable, the http resource. // https resource or, if unavailable, the http resource.
func httpsOrHTTP(importPath string) (urlStr string, body io.ReadCloser, err error) { func httpsOrHTTP(importPath string) (urlStr string, body io.ReadCloser, err error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment