#!/bin/bash # 构建脚本:交叉编译 Linux amd64 二进制 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o app chmod +x app echo "构建完成: ./app"