英文:
How to get golang programming tour offline
问题
我想要离线下载go-tour,我该怎么做?我尝试使用以下代码进行下载,但是没有成功:
go get code.google.com/p/go-tour/gotour
英文:
I wanted to download go-tour offline
how can i get it?
I have tried to use code
go get code.google.com/p/go-tour/gotour
but it doesn't work.
答案1
得分: 9
如果你说“它不起作用”是指你收到错误消息:package code.google.com/p/go-tour/gotour: cannot download, $GOPATH not set. For more details see: go help gopath
,那么你需要设置GOPATH,然后使用go get
命令获取所需的包。
无论如何,这是使GoTour工作的完整解决方案,假设你已经安装了Go。
mkdir go_tour && cd go_tour
export GOPATH=`pwd`
go get code.google.com/p/go-tour/gotour
./bin/gotour
英文:
If by saying "it doesn't work" you mean that you get error message: package code.google.com/p/go-tour/gotour: cannot download, $GOPATH not set. For more details see: go help gopath
, then you need to setup GOPATH and then go get
desired package.
Anyway, here is the complete solution to get GoTour working, assuming you already have Go installed.
mkdir go_tour && cd go_tour
export GOPATH=`pwd`
go get code.google.com/p/go-tour/gotour
./bin/gotour
答案2
得分: -1
"it doesn't work"的具体问题是什么?
$ go get code.google.com/p/go-tour/gotour
$ gotour
2014/03/22 20:02:53 从/Users/matt/.go/src/code.google.com/p/go-tour提供内容
2014/03/22 20:02:53 应该会打开一个浏览器窗口。如果没有,请访问http://127.0.0.1:3999
对我来说没有问题。请确保你的$GOPATH
正确设置并在你的shell中导出。检查go env
的输出以确认。
英文:
Can you expand on "it doesn't work"?
$ go get code.google.com/p/go-tour/gotour
$ gotour
2014/03/22 20:02:53 Serving content from /Users/matt/.go/src/code.google.com/p/go-tour
2014/03/22 20:02:53 A browser window should open. If not, please visit http://127.0.0.1:3999
No problems for me. Make sure your $GOPATH
is set correctly and exported in your shell. Check the output of go env
to confirm.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论