"os/exec"
"os/user"
"path/filepath"
- "strconv"
"strings"
)
if goroot == "" {
log.Fatal("No $GOROOT set.")
}
- isGoDeveloper := exec.Command("hg", "pq").Run() == nil
- if !isGoDeveloper && !forceAPICheck() {
- fmt.Println("Skipping cmd/api checks; hg codereview extension not available and GO_FORCE_API_CHECK not set")
+ _, err := exec.LookPath("hg")
+ if err != nil {
+ fmt.Println("Skipping cmd/api checks; hg not available")
return
}
return filepath.Join(goroot, "api", s[0]+".txt")
}
-// GO_FORCE_API_CHECK is set by builders.
-func forceAPICheck() bool {
- v, _ := strconv.ParseBool(os.Getenv("GO_FORCE_API_CHECK"))
- return v
-}
-
// prepGoPath returns a GOPATH for the "go" tool to compile the API tool with.
// It tries to re-use a go.tools checkout from a previous run if possible,
// else it hg clones it.