Add pkg/parsers/architecture and pkg/platform
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
6dab26120b
commit
4ee0608373
4 changed files with 118 additions and 0 deletions
15
platform/architecture_freebsd.go
Normal file
15
platform/architecture_freebsd.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package platform
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
// GetRuntimeArchitecture get the name of the current architecture (x86, x86_64, …)
|
||||
func GetRuntimeArchitecture() (string, error) {
|
||||
cmd := exec.Command("uname", "-m")
|
||||
machine, err := cmd.Output()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(machine), nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue