下载go的Linux二进制包,https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
可以解压到自己喜欢的目录中,如”/home/work/go”。

1
tar -C -xzf go1.13.4.linux-amd64.tar.gz

然后设置环境变量。

1
export PATH=$PATH:/home/work/go/bin

这个时候,运行go命令,应该就可以返回成功的结果了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$ go

Go is a tool for managing Go source code.

Usage:

go <command> [arguments]

The commands are:

bug start a bug report
build compile packages and dependencies
clean remove object files and cached files
doc show documentation for package or symbol
env print Go environment information
fix update packages to use new APIs
fmt gofmt (reformat) package sources
generate generate Go files by processing source
get download and install packages and dependencies
install compile and install packages and dependencies
list list packages or modules
mod module maintenance
run compile and run Go program
test test packages
tool run specified go tool
version print Go version
vet report likely mistakes in packages
...