Atom Go-plus package auto downloading tools I dont need.

xuanbao · 2017-08-23 21:00:03 · 748 次点击    
这是一个分享于 2017-08-23 21:00:03 的资源,其中的信息可能已经有所发展或是发生改变。

If anyone out there could help me solve this dilemma I would be grateful. Go-plus consistently puts a golang.org and github.com directory in every single project I change my gopath too and also fills my binaries folder up. This is incredibly irritating and it does not do this to my colleges. Need help.


评论:

dlsniper:

Atom does that because it needs to have access to the go tools that it downloads. My guess is that if you take those binaries from GOPATH/bin and put them somewhere in your PATH where they are not affected by your GOPATH per project model, then this will stop happening (but I'm not familiar with Atom, just an educated guess).

10F1:

They recently fixed that in the vscode-go plugin, it was annoying as hell, now there's an option to set a specific path for the tools.

mouthBeard:

I think the assumption the plugin is making is that you have a default GOPATH who's bin directory is also in your PATH. For me, this translates to this being at the end of my ~/.profile:

export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"

that way, any binaries that get installed with go get endup in my path if my current gopath is this default gopath.

joefitzgerald:

There is not an assumption that you have a default GOPATH. There is an assumption that you have the various tools available either in:

  • $GOPATH/bin (using the first $GOPATH segment)
  • Any of your $PATH segments

/u/eveilslayer could work around this issue in a few ways:

  • Manually go get all the required tools and ensure the resulting binaries are available on the PATH
  • Create a tools GOPATH (e.g. ~/tools), add its bin directory to the PATH, launch atom via GOPATH=~/tools atom ., let go-plus fetch all the tools

Either of these approaches will suppress the behavior you are seeing when subsequently launching GOPATH=~/project-1 atom ., GOPATH=~/project-2 atom ., etc.


入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

748 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传