architecture_freebsd.go 309 B

123456789101112131415
  1. package platform
  2. import (
  3. "os/exec"
  4. )
  5. // GetRuntimeArchitecture get the name of the current architecture (x86, x86_64, …)
  6. func GetRuntimeArchitecture() (string, error) {
  7. cmd := exec.Command("uname", "-m")
  8. machine, err := cmd.Output()
  9. if err != nil {
  10. return "", err
  11. }
  12. return string(machine), nil
  13. }