Skip to content

Commit

Permalink
fix: utils/os: align architecture with pacman ones
Browse files Browse the repository at this point in the history
  • Loading branch information
M0Rf30 committed Oct 20, 2024
1 parent d3b2bd2 commit 94ca0ca
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/utils/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"runtime"
)

// GetArchitecture returns the corresponding uname -m output for the current GOARCH.
// GetArchitecture returns the corresponding pacman architecture for the current GOARCH.
func GetArchitecture() string {
// Create a map of GOARCH values to uname -m outputs
// Create a map of GOARCH values to pacman arch ones
architectureMap := map[string]string{
"amd64": "x86_64",
"386": "i386",
"arm": "armv7l", // Common for ARM 32-bit
"386": "i686",
"arm": "armv7h", // Common for ARM 32-bit
"arm64": "aarch64", // Common for ARM 64-bit
"ppc64": "ppc64",
"ppc64le": "ppc64le",
Expand All @@ -24,8 +24,8 @@ func GetArchitecture() string {
// Get the current architecture using runtime.GOARCH
currentArch := runtime.GOARCH

// Get the corresponding uname -m output from the map
unameOutput := architectureMap[currentArch]
// Get the corresponding pacman architecture from the map
pacmanArch := architectureMap[currentArch]

return unameOutput
return pacmanArch
}

0 comments on commit 94ca0ca

Please sign in to comment.