2015-11-14 22:03:02 +00:00
|
|
|
// Package platform provides helper function to get the runtime architecture
|
|
|
|
// for different platforms.
|
|
|
|
package platform
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
2015-11-19 13:55:57 +00:00
|
|
|
// runtimeArchitecture get the name of the current architecture (x86, x86_64, …)
|
|
|
|
func runtimeArchitecture() (string, error) {
|
2015-11-14 22:03:02 +00:00
|
|
|
utsname := &syscall.Utsname{}
|
|
|
|
if err := syscall.Uname(utsname); err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
return charsToString(utsname.Machine), nil
|
|
|
|
}
|