Commit 29272b1e authored by Caio Marcelo de Oliveira Filho's avatar Caio Marcelo de Oliveira Filho Committed by Josh Bleecher Snyder

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/28531Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 2939f395
......@@ -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 {
......
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