12345678910111213141516171819 |
- # Pre Set
- set -x
- # Set ENV
- export GO111MODULE=on # Go1.11.x 版本需要开启
- export GOPROXY=https://goproxy.cn
- export GOPRIVATE=gogs.uu.mdfitnesscao.com # 私有仓库地址
- # Set Var
- Src=./ # 程序源码
- Out="app"
- Options="-a -installsuffix cgo -o"
- PreSet='GOOS=linux GOARCH=amd64' # 构建变量设置
- # Build
- go version
- go env
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags=jsoniter -o ${Out} ${Src} # build
|