Golang开发编译环境配置

Golang 1.13

使用vim-go

  • vim-go 需要Vim 7.4.2009, 默认的centos7 上 yum 安装的是7.4.1006, 所以先升级
[@sjs_19_176 ~]# yum install -y gcc gcc-c++ ruby ruby-devel lua lua-devel \
ctags git python python-devel \
tcl-devel ncurses-devel \
perl perl-devel perl-ExtUtils-ParseXS \
perl-ExtUtils-CBuilder \
perl-ExtUtils-Embed
[@sjs_19_176 ~]#  wget https://github.com/vim/vim/archive/v7.4.2367.tar.gz ; tar -zxf  v7.4.2367.tar.gz; cd vim-7.4.2367
[@sjs_19_176 vim-7.4.2367]#  ./configure --with-features=huge --enable-multibyte --enable-rubyinterp=yes --enable-pythoninterp=yes --with-python-config-dir=/usr/lib64/python2.7/config --enable-perlinterp=yes --enable-luainterp=yes --enable-cscope --prefix=/usr/local

不使用go mod

[@sjs_19_176 ~]$ # go env -w GOPROXY=https://goproxy.io,direct
[@sjs_19_176 ~]$ go env -w GOPROXY=https://goproxy.cn,direct
[@sjs_19_176 ~]$ go env -w GOPRIVATE=git.sogou-inc.com

Makefile

PROJECT_BIN := demo                                                                                                                                                  
all: test build
    @echo ">>>>>> building done!"
test:
    go test -v -cover ./...
# Build the binary file
# -w 禁止生成debug信息,注意使用该选项后,无法使用 gdb 进行调试
# -s 禁用符号表
build: 
    go build -ldflags "-s -w" -o $(PROJECT_BIN)  main.go

你可能感兴趣的:(Golang)