本地安装 A tour of Go中文版
先自行到官网安装Go.
配置Goproxy 中国
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
接下来设定工作空间。
一个例子,根据自己需要修改路径。
参考:https://learnku.com/go/wikis/38166
#如果在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-use\go_work\bin\tour.exe
运行这个.exe文件,可以单击运行,也可以命令行运行。即可看到中文内容。
2020/05/15 20:56:08 Serving content from D:\git-for-use\go_work\src\golang.org\x\tour
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
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步