architecture_unix.go 365 B

123456789101112131415161718
  1. // +build freebsd solaris
  2. package platform
  3. import (
  4. "os/exec"
  5. "strings"
  6. )
  7. // runtimeArchitecture get the name of the current architecture (i86pc, sun4v)
  8. func runtimeArchitecture() (string, error) {
  9. cmd := exec.Command("/usr/bin/uname", "-m")
  10. machine, err := cmd.Output()
  11. if err != nil {
  12. return "", err
  13. }
  14. return strings.TrimSpace(string(machine)), nil
  15. }