1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/internal/linux/arch.go

25 lines
548 B
Go
Raw Normal View History

2017-08-27 18:18:23 +02:00
// Package linux contains functions that are useful to generate linux packages.
package linux
import "strings"
// Arch converts a goarch to a linux-compatible arch
//
// list of all linux arches: `go tool dist list | grep linux`
2017-08-27 18:18:23 +02:00
func Arch(key string) string {
var arch = strings.TrimPrefix(key, "linux")
switch arch {
case "386":
2017-08-27 18:18:23 +02:00
return "i386"
case "amd64":
return "amd64"
case "arm5": // GOARCH + GOARM
return "armel"
case "arm6": // GOARCH + GOARM
return "armhf"
case "arm7": // GOARCH + GOARM
2017-08-27 18:18:23 +02:00
return "armhf"
}
return arch
2017-08-27 18:18:23 +02:00
}