mirror of https://github.com/golang/go.git
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:
parent
2939f395e0
commit
29272b1e61
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue