github.com/joselitofilho/goreleaser@v0.155.1-0.20210123221854-e4891856c593/internal/linux/arch.go (about) 1 // Package linux contains functions that are useful to generate linux packages. 2 package linux 3 4 import "strings" 5 6 // Arch converts a goarch to a linux-compatible arch. 7 func Arch(key string) string { 8 // XXX: list of all linux arches: `go tool dist list | grep linux` 9 var arch = strings.TrimPrefix(key, "linux") 10 switch arch { 11 case "386": 12 return "i386" 13 case "amd64": 14 return "amd64" 15 case "arm5": // GOARCH + GOARM 16 return "armel" 17 case "arm6": // GOARCH + GOARM 18 return "armhf" 19 case "arm7": // GOARCH + GOARM 20 return "armhf" 21 default: 22 return arch 23 } 24 }