github.com/isyscore/isc-gobase@v1.5.3-0.20231218061332-cbc7451899e9/system/host/host_posix.go (about) 1 //go:build linux || darwin 2 3 package host 4 5 import ( 6 "bytes" 7 8 "golang.org/x/sys/unix" 9 ) 10 11 func KernelArch() (string, error) { 12 var utsname unix.Utsname 13 err := unix.Uname(&utsname) 14 return string(utsname.Machine[:bytes.IndexByte(utsname.Machine[:], 0)]), err 15 }