cmd/composer: move currentArch helper to common package

The helper function might be useful also in different parts of the project.
This commit is contained in:
Ondřej Budai 2020-02-24 14:04:08 +01:00 committed by Tom Gundersen
parent 740fb77d64
commit 80f0888896
2 changed files with 19 additions and 16 deletions

View file

@ -0,0 +1,17 @@
package common
import "runtime"
func CurrentArch() string {
if runtime.GOARCH == "amd64" {
return "x86_64"
} else if runtime.GOARCH == "arm64" {
return "aarch64"
} else if runtime.GOARCH == "ppc64le" {
return "ppc64le"
} else if runtime.GOARCH == "s390x" {
return "s390x"
} else {
panic("unsupported architecture")
}
}