pkg/platform/architecture_freebsd.go
Vincent Demeester 4ee0608373 Add pkg/parsers/architecture and pkg/platform
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-11-14 23:03:02 +01:00

15 lines
309 B
Go

package platform
import (
"os/exec"
)
// GetRuntimeArchitecture get the name of the current architecture (x86, x86_64, …)
func GetRuntimeArchitecture() (string, error) {
cmd := exec.Command("uname", "-m")
machine, err := cmd.Output()
if err != nil {
return "", err
}
return string(machine), nil
}