GoToolchain
1.1、GoToolchain简介

GoToolchain中包含的工具:

工具作用
go
golangRuntime
golangCompiler
golangBuild System
golangPackage Manager
gofmt格式化代码的工具
godoc生成文档的工具
1.2、通过包管理器安装GoToolchain
操作系统包管理器仓库安装命令
Windowsscoopofficalscoop install go
WindowsChocolateyofficalchoco install -y golang
macOSHomeBrewofficalbrew install go
GNU/LinuxLinuxBrewofficalbrew install go
aptofficalsudo apt-get install -y golang
CentOSyumEPELsudo yum install -y epel-release
sudo yum install -y golang
dnfofficalsudo dnf install -y golang
openSUSEzypperofficalsudo zypper install -y go
Alpine Linuxapkofficalsudo apk add go

Arch Linux

ArcoLinux

Manjaro Linux

pacmanofficalsudo pacman -Syyu --noconfirm
sudo pacman -S    --noconfirm go
Gentoo LinuxPortageofficalsudo emerge go
1.3、使用编译好的二进制压缩包安装GoToolchain

step1、安装依赖

下载时cURL
解压时targzip
运行时glibc ( libc.solibpthread.sold-linux-x86-64.so )

step2、使用curl命令下载编译好的二进制压缩包 (

curl -LO https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz

step3、使用tar解压压缩包:

tar vxf go1.12.7.linux-amd64.tar.gz

step4、进入go目录,并查看它的内容:

step5、将go/bin目录加入PATH环境变量中:

export PATH=$PATH:~/go/bin