debian-forge-composer/internal/common/helpers.go
Ondřej Budai 80f0888896 cmd/composer: move currentArch helper to common package
The helper function might be useful also in different parts of the project.
2020-02-26 16:58:39 +01:00

17 lines
337 B
Go

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")
}
}