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条)

报告相同问题?

悬赏问题

  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行