github.com/rumpl/bof@v23.0.0-rc.2+incompatible/pkg/platform/architecture_unix.go (about) 1 //go:build !windows 2 // +build !windows 3 4 // Package platform provides helper function to get the runtime architecture 5 // for different platforms. 6 package platform // import "github.com/docker/docker/pkg/platform" 7 8 import ( 9 "golang.org/x/sys/unix" 10 ) 11 12 // runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...) 13 func runtimeArchitecture() (string, error) { 14 utsname := &unix.Utsname{} 15 if err := unix.Uname(utsname); err != nil { 16 return "", err 17 } 18 return unix.ByteSliceToString(utsname.Machine[:]), nil 19 }