英文:
Configure Eclipse as Go IDE
问题
我决定使用Eclipse(带有goClipse插件)作为我的Go项目的编辑器。
在选择Eclipse之前,我已经安装了Go,并将c:\go-workspace指定为我的工作区。
现在,我想要配置Eclipse,将该工作区设置为我的Go工作位置。我计划从GitHub导入各种项目,并创建自己的GitHub账户,以便提交更改等。所有这些导入都将位于src/目录下,根据这篇文章的建议,最好将所有内容都放在一个Go工作区的src/目录下:https://talks.golang.org/2014/organizeio.slide#9。
我在Eclipse中创建Go项目时遇到了问题。
我选择文件 > 新建Go项目,并浏览到c:\go-workspace。
我在对话框中输入项目名称,但是收到一条消息,说指定位置已经存在一个目录,我唯一的选择是取消。
然后,我尝试创建一个新的Eclipse工作区,但是当Eclipse完成后,它指示这是一个Java项目。
我应该如何实现我想做的事情?或者也许我想做的事情的"最佳实践"是其他什么。
英文:
I've decided to use Eclipse (with the goClipse plugin) as my editor for go projects.
I already had go installed and (before choosing Eclipse) I had designated c:\go-workspace as my workspace.
I now want to configure Eclipse to use that workspace as my location for go work.
I plan to import various projects from github and create my own github account where I can commit changes, etc. All those imports will be under the src/directory, and this is in accordance with this article that seems to indicate it is best to have one go workspace with everything under the src/ directory: https://talks.golang.org/2014/organizeio.slide#9.
I'm having issues creating a go project in Eclipse.
I choose File > New Go Project and browse to c:\go-workspace.
I enter a project name in the dialog but I get a message saying that a directory already exists at the specified location and my only choice is to cancel.
I then tried creating a new Eclipse workspace but when Eclipse was finished it indicated it is a Java project.
How do I accomplish what I want to do? Or perhaps the "best practice" for what I want to do is something else.
答案1
得分: 2
好的,以下是翻译好的内容:
好的,你已经决定使用IntelliJ,但也许其他人可能对答案感兴趣...
我也曾与GoClipse有过一些争执,但最终我解决了它。解决方法是输入整个路径(包括项目名称)。所以例如你的GOPATH是(在Linux上)/home/username/go,你想创建一个名为"gopro"的项目,并将其放在"/home/username/go/src/github.com/user"中,你需要在Eclipse窗口中输入:"/home/username/go/src/github.com/user/gopro"。之后一切应该都能正常工作,没有任何问题。
英文:
Ok, you already decided to go for IntelliJ but maybe someone else might be interested in an answer though ...
I also had some fights with GoClipse but finally I got it working. The solution is to input the whole path (including the project name). So for example your GOPATH is (on Linux) /home/username/go and you want to create a project named "gopro" and want to place it in "/home/username/go/src/github.com/user" you need to type in the Eclipse window: "/home/username/go/src/github.com/user/gopro". Everything should work without any problems afterwards.
答案2
得分: 0
我找不到这个问题的答案。我决定使用带有golang插件的IntelliJ,这个解决方案非常好用。
英文:
I could not find an answer to this question. I've decided to use IntelliJ with the golang plugin and this solution works wonderfully.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论