修改配置文件:
nano ~/.bash_profile
ORIG_GOPATH=/Users/piao/Go export GOPATH=/tmp/go export GOROOT_FINAL=/tmp/go1 [ ! -d $GOPATH ] && ln -s "$ORIG_GOPATH" "$GOPATH" [[ ! $PATH =~ $GOPATH ]] && export PATH=$PATH:$GOPATH/bin
去掉符号信息:
go build -ldflags "-s -w" main.go
详细的链接参数可以用下面命令行查看:
go tool link -h
发表评论