简体   繁体   English

将Eclipse配置为Go IDE

[英]Configure Eclipse as Go IDE

I've decided to use Eclipse (with the goClipse plugin) as my editor for go projects. 我决定将Eclipse(带有goClipse插件)用作go项目的编辑器。 I already had go installed and (before choosing Eclipse) I had designated c:\\go-workspace as my workspace. 我已经安装好了(在选择Eclipse之前),我已将c:\\ go-workspace指定为我的工作区。

I now want to configure Eclipse to use that workspace as my location for go work. 现在,我想配置Eclipse以使用该工作空间作为我上班的位置。 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 . 我计划从github导入各种项目,并创建我自己的github帐户,我可以在其中提交更改,等等。所有这些导入都将在src /目录下,并且这与本文一致,似乎表明最好拥有一站式工作区,其中所有内容都位于src /目录下: https : //talks.golang.org/2014/organizeio.slide#9

I'm having issues creating a go project in Eclipse. 我在Eclipse中创建go项目时遇到问题。 I choose File > New Go Project and browse to c:\\go-workspace. 我选择“文件”>“新建Go项目”,然后浏览到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. 然后,我尝试创建一个新的Eclipse工作区,但是当Eclipse完成时,它表明它是一个Java项目。

How do I accomplish what I want to do? 如何完成我想做的事? Or perhaps the "best practice" for what I want to do is something else. 也许我想要做的“最佳实践”是其他的事情。

Ok, you already decided to go for IntelliJ but maybe someone else might be interested in an answer though ... 好的,您已经决定选择IntelliJ,但是也许其他人可能会对答案感兴趣……

I also had some fights with GoClipse but finally I got it working. 我还与GoClipse进行了一些斗争,但最终我使它起作用了。 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". 因此,例如,您的GOPATH是(在Linux上)/ home / username / go,并且您想要创建一个名为“ gopro”的项目,并将其放置在“ /home/username/go/src/github.com/user”中需要在Eclipse窗口中输入:“ / home / username / go / src / github.com / user / gopro”。 Everything should work without any problems afterwards. 此后一切都应正常工作。

I could not find an answer to this question. 我找不到这个问题的答案。 I've decided to use IntelliJ with the golang plugin and this solution works wonderfully. 我决定将IntelliJ与golang插件一起使用,该解决方案效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM