24 lines
401 B
Go
24 lines
401 B
Go
package goenv
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
|
|
"zlh-agent/internal/state"
|
|
)
|
|
|
|
const goBin = "/opt/zlh/runtime/go/bin/go"
|
|
|
|
func Verify(cfg state.Config) error {
|
|
if _, err := os.Stat(goBin); err != nil {
|
|
return fmt.Errorf("go binary missing at %s", goBin)
|
|
}
|
|
|
|
if err := exec.Command(goBin, "version").Run(); err != nil {
|
|
return fmt.Errorf("go runtime not executable: %w", err)
|
|
}
|
|
|
|
return nil
|
|
}
|