douquejituan938904 2014-02-24 19:43
浏览 308
已采纳

更改GOPATH后安装了godoc,现在我需要将它放入GOPATH中吗?

While following a tutorial I hit a wall when it wanted me to run godoc. It was missing.

After a bit of searching around, I discovered:

  • godoc has been changed for 1.2, so it's a separate library and binary.
  • You have to get it through "go get", which won't work without GOPATH.
  • Binary installations apparently include godoc? I installed from source, so it's not included by default.

I exported a GOPATH to my current application path /home/me/go_project/test. GOROOT was already set. (Note: GOPATH doesn't like to be set the same as GOROOT)

After that I ran "go get code.google.com/p/go.tools/cmd/godoc" and it dutifully installed the binary into my GOROOT/bin (yay!)

It also created a pkg installation under my /home/me/go_project/test/src/code.google.com/p... (Um...wat?)

I really don't need that code.google... bit under my test application; is there any reason Go would need that kept there? It doesn't alter anything in library paths or dependencies or anything, does it?

Essentially...can I just use the binary it put in GOROOT/bin and erase the stuff it put under my go_project application directory without affecting Go?

  • 写回答

2条回答 默认 最新

  • douju9847 2014-02-24 20:14
    关注

    Essentially...can I just use the binary it put in GOROOT/bin and erase the stuff it put under my > go_project application directory without affecting Go?

    Yes. Go binaries are statically linked (almost).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan