1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:34:40 -07:00

cmd/api: don't fail API check if there's no network

If the hg checkout of go.tools fails, check for Internet
connectivity before failing.

R=golang-dev, shivakumar.gn
CC=golang-dev
https://golang.org/cl/12814043
This commit is contained in:
Brad Fitzpatrick 2013-08-12 19:18:47 -07:00
parent 4984e6e9fd
commit 4d2494330e

View File

@ -16,6 +16,7 @@ package main
import (
"fmt"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
@ -109,6 +110,10 @@ func prepGoPath() string {
cmd.Dir = cloneDir
out, err := cmd.CombinedOutput()
if err != nil {
if _, err := http.Head("http://ip.appspot.com/"); err != nil {
log.Printf("# Skipping API check; network appears to be unavailable")
os.Exit(0)
}
log.Fatalf("Error running hg clone on go.tools: %v\n%s", err, out)
}
if err := os.Rename(tmpDir, finalDir); err != nil {