github.com/rish1988/moby@v25.0.2+incompatible/pkg/platform/platform_unix.go (about)

     1  //go:build !windows
     2  
     3  package platform // import "github.com/docker/docker/pkg/platform"
     4  
     5  import (
     6  	"golang.org/x/sys/unix"
     7  )
     8  
     9  // runtimeArchitecture gets the name of the current architecture (x86, x86_64, i86pc, sun4v, ...)
    10  func runtimeArchitecture() (string, error) {
    11  	utsname := &unix.Utsname{}
    12  	if err := unix.Uname(utsname); err != nil {
    13  		return "", err
    14  	}
    15  	return unix.ByteSliceToString(utsname.Machine[:]), nil
    16  }