cmd/go: use httpGET helper in bug command

Use existing helper function instead of importing "net/http". This
allows the go_bootstrap build to not depend on "net/http" package.
See cmd/go/http.go for details.

Fixes build bootstrap build with all.bash.

Change-Id: I2fd0fb01af7774f1690a353af22137680ec78170
Reviewed-on: https://go-review.googlesource.com/28531
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Caio Marcelo de Oliveira Filho 2016-09-05 15:14:55 -03:00 committed by Josh Bleecher Snyder
parent 2939f395e0
commit 29272b1e61
1 changed files with 2 additions and 11 deletions

View File

@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"os/exec"
"runtime"
"strings"
@ -83,15 +82,7 @@ func printCDetails() {
}
func inspectGoVersion() {
resp, err := http.Get("https://golang.org/VERSION?m=text")
if err != nil {
if buildV {
fmt.Printf("failed to GET golang.org/VERSION: %v\n", err)
}
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
data, err := httpGET("https://golang.org/VERSION?m=text")
if err != nil {
if buildV {
fmt.Printf("failed to read from golang.org/VERSION: %v\n", err)
@ -102,7 +93,7 @@ func inspectGoVersion() {
// golang.org/VERSION currently returns a whitespace-free string,
// but just in case, protect against that changing.
// Similarly so for runtime.Version.
release := string(bytes.TrimSpace(body))
release := string(bytes.TrimSpace(data))
vers := strings.TrimSpace(runtime.Version())
if vers == release {