* Vendors packages * Adds a Makefile that uses docker to build a static binary against musl using alpine linux. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
20 lines
374 B
Go
20 lines
374 B
Go
//go:build linux
|
|
|
|
package osarch
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// ArchitectureGetLocal returns the local hardware architecture
|
|
func ArchitectureGetLocal() (string, error) {
|
|
uname := unix.Utsname{}
|
|
err := unix.Uname(&uname)
|
|
if err != nil {
|
|
return ArchitectureDefault, err
|
|
}
|
|
|
|
return string(uname.Machine[:bytes.IndexByte(uname.Machine[:], 0)]), nil
|
|
}
|