github.com/ttys3/engine@v17.12.1-ce-rc2+incompatible/pkg/platform/architecture_unix.go (about) 1 // +build freebsd darwin 2 3 // Package platform provides helper function to get the runtime architecture 4 // for different platforms. 5 package platform 6 7 import ( 8 "os/exec" 9 "strings" 10 ) 11 12 // runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...) 13 func runtimeArchitecture() (string, error) { 14 cmd := exec.Command("/usr/bin/uname", "-m") 15 machine, err := cmd.Output() 16 if err != nil { 17 return "", err 18 } 19 return strings.TrimSpace(string(machine)), nil 20 }