本地安装 A tour of Go中文版

先自行到官网安装Go.
配置Goproxy 中国

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

接下来设定工作空间。
一个例子,根据自己需要修改路径。

#如果在windows上使用git-for-windows带来的git-bash运行的。
$ mkdir D:/git-for-use/go_work
$ export GOPATH=D:/git-for-use/go_work
$ export PATH=$PATH:$GOPATH/bin

接下来运行

 go get -u github.com/Go-zh/tour

下载成功后

ls -al $GOPATH/pkg/mod/github.com/!go-zh


执行

#可能会报错Couldn't find tour files: could not find go-tour content; check $GOROOT and $GOPATH

tour

如果报错,那就到D:git-for-usego_workin our.exe
运行这个.exe文件,可以单击运行,也可以命令行运行。即可看到中文内容。

2020/05/15 20:56:08 Serving content from D:git-for-usego_worksrcgolang.orgx	our
2020/05/15 20:56:08 A browser window should open. If not, please visit http://127.0.0.1:3999
2020/05/15 20:56:09 accepting connection from: 127.0.0.1:64772

原文地址:https://www.cnblogs.com/lingr7/p/12883779.html