记录编译工具代码 Makefile
替换binary路径使用
BINARY={Path} GOARCH=amd64 VERSION?=? BUILD=`date +%FT%T%z`LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}".PHONY: help build linux darwin windows clean versionhelp: @echo "usage: make <option>" @echo "options and effects:" @echo " help : Show help" @echo " build : Build the binary of this project for current platform" @echo " linux : Build the linux binary of this project" @echo " darwin : Build the darwin binary of this project" @echo " windows: Build the windows binary of this project" @echo " clean : Remove binaries" @echo " version: Display Go version"build: @go build ${LDFLAGS} -o ${BINARY}linux: @GOOS=linux GOARCH=${GOARCH} go build ${LDFLAGS} -o ${BINARY}-linux-${GOARCH}darwin: @GOOS=darwin GOARCH=${GOARCH} go build ${LDFLAGS} -o ${BINARY}-darwin-${GOARCH}windows: @GOOS=windows GOARCH=${GOARCH} go build ${LDFLAGS} -o ${BINARY}-windows-${GOARCH}.execlean: @rm -f ${BINARY} @rm -f ${BINARY}-*version: @go version%
记录上传测试环境工具代码
#!/usr/bin/env bashmake linux rsync -avzrC Go-linux-amd64 config/test.yaml axdict@127.0.0.1:/home/axdict/go/
替换本地ip为远端ip 和 要同步的文件
作者:保儿洁
链接:https://www.jianshu.com/p/30379df1554a
點(diǎn)擊查看更多內(nèi)容
為 TA 點(diǎn)贊
評論
評論
共同學(xué)習(xí),寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦