go 1.14.7 安装

go 1.14.7 安装

  • 1,卸载已经安装的go版本
  • 2,安装go 1.14.7

1,卸载已经安装的go版本

# go version
go version go1.14.4 linux/amd64
# go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/work"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/storage/lotuswork/tmpdir/go-build084130302=/tmp/go-build -gno-record-gcc-switches"
# which go
/usr/local/go/bin/go
# which gofmt
/usr/local/go/bin/gofmt
  • 删除
rm -rf /usr/local/go

2,安装go 1.14.7

tar -C /usr/local -zxvf go1.14.7.linux-amd64.tar.gz
# which go
/usr/local/go/bin/go
# go version
go version go1.14.7 linux/amd64
  • cat .profile 设置环境变量
# go
export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

参考:

  1. linux go 安装 卸载
  2. Install the Go

你可能感兴趣的:(go,go,1.14.7)