fix(cli): replace runtime.GOEXE with hardcoded "go" in test

runtime.GOEXE is not available in Go 1.25 standard library.
Replace with the standard "go" binary name which is on PATH in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Molecule AI · sdk-dev 2026-04-22 19:03:36 +00:00
parent 6d1bcc007f
commit 9dfb5f9aa4

View File

@ -8,7 +8,6 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"testing"
)
@ -207,8 +206,7 @@ func repoRoot() string {
func mol(t *testing.T) string {
root := repoRoot()
exe := filepath.Join(t.TempDir(), "molecule")
goBin := runtime.GOEXE // e.g. "/usr/bin/go" — respects PATH
cmd := exec.Command(goBin, "build", "-o", exe, "./cmd/molecule")
cmd := exec.Command("go", "build", "-o", exe, "./cmd/molecule")
cmd.Dir = root
out, err := cmd.CombinedOutput()
if err != nil {