popeyelau / wiki

📒Wiki for many useful notes, source, commands and snippets.
2 stars 0 forks source link

Golang 打包&压缩 #15

Open popeyelau opened 5 years ago

popeyelau commented 5 years ago

打包&压缩

Linux 64

GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o dogetv-cli dogetv-cli.go && upx ./dogetv-cli

Windows 64

GOOS=windows GOARCH=amd64 go build -ldflags '-w -s' -o dogetv-cli.exe dogetv-cli.go && upx ./dogetv-cli.exe

macOS

GOOS=darwin GOARCH=amd64 go build -ldflags '-w -s' -o dogetv-cli dogetv-cli.go && upx ./dogetv-cli

安装UPX

UPX: the Ultimate Packer for eXecutables 使用 Homebrew 安装 brew install upx

popeyelau commented 1 year ago
GOOS - Target Operating System GOARCH - Target Platform
android arm
darwin 386
darwin amd64
darwin arm
darwin arm64
dragonfly amd64
freebsd 386
freebsd amd64
freebsd arm
linux 386
linux amd64
linux arm
linux arm64
linux ppc64
linux ppc64le
linux mips
linux mipsle
linux mips64
linux mips64le
netbsd 386
netbsd amd64
netbsd arm
openbsd 386
openbsd amd64
openbsd arm
plan9 386
plan9 amd64
solaris amd64
windows 386
windows amd64