2015-11-14 22:03:02 +00:00
|
|
|
package platform
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
)
|
|
|
|
|
2016-04-09 13:18:15 +00:00
|
|
|
// runtimeArchitecture gets the name of the current architecture (x86, x86_64, …)
|
2015-11-19 13:55:57 +00:00
|
|
|
func runtimeArchitecture() (string, error) {
|
2015-11-14 22:03:02 +00:00
|
|
|
cmd := exec.Command("uname", "-m")
|
|
|
|
machine, err := cmd.Output()
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
return string(machine), nil
|
|
|
|
}
|