天天看点

golang下载和安装下载安装和卸载命令介绍

下载

官网:https://golang.org/dl/ 下载对应系统的安装包

安装和卸载

官方安装https://golang.org/doc/install指导。

tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

export PATH=$PATH:/usr/local/go/bin      

移除环境变量配置和/usr/local/go目录

Go wiki: https://github.com/golang/go/wiki

命令介绍

go <command> [arguments]      
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         add dependencies to current module and install them      
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      

参考:

https://golang.org/cmd/go/