cmd/ebitenmobile: Use GOROOT/bin/go instead of go

Fixes #927
This commit is contained in:
Hajime Hoshi 2019-08-24 01:06:14 +09:00
parent c49815a2b2
commit a42b5274df
2 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
)
const gomobileHash = "597adff16ade9d88626f8caea514bb189b8c74ee"
@ -54,7 +55,8 @@ func runGo(args ...string) error {
env := []string{
"GO111MODULE=on",
}
return runCommand("go", args, env)
gocmd := filepath.Join(runtime.GOROOT(), "bin", "go")
return runCommand(gocmd, args, env)
}
func prepareGomobileCommands() error {

View File

@ -22,6 +22,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"text/template"
@ -45,7 +46,8 @@ func goEnv(name string) string {
if val := os.Getenv(name); val != "" {
return val
}
val, err := exec.Command("go", "env", name).Output()
gocmd := filepath.Join(runtime.GOROOT(), "bin", "go")
val, err := exec.Command(gocmd, "env", name).Output()
if err != nil {
panic(err)
}