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:
parent
740fb77d64
commit
80f0888896
2 changed files with 19 additions and 16 deletions
17
internal/common/helpers.go
Normal file
17
internal/common/helpers.go
Normal 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")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue