Basic cross-compile
GOOS=linux GOARCH=arm64 go build -o nama_sistem_arm64 main.go
Strip debug info (reduce size)
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o nama_sistem_arm64 main.go
Enable optimizations
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o nama_sistem_arm64 main.go
Reproducible build (consistent hash)
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -buildvcs=false -o nama_sistem_arm64 main.go
Extra: compress with UPX (optional)
upx --best --lzma nama_sistem_arm64
Top comments (0)