使用IntelliJ Golang插件,如何运行整个Golang项目而不是单个文件?

huangapple go评论82阅读模式
英文:

Using IntelliJ Golang plugin, how to run entire Golang project instead of a single file?

问题

我正在使用最新的(2014-01-03)IntelliJ的Golang插件,这是我第一次使用。

通常,我的终端工作流程是执行 go build && ./executable -args=1

所以我尝试创建一个启动配置来执行相同的操作,我采取了以下步骤:

  • 创建一个“Go应用程序”配置
  • 填写GOPATH/GOROOT环境变量
  • 填写命令行参数
  • 因为必须有一个要运行的文件,所以我选择了一个包含 func main() 的文件

然后出现了一个问题。当我运行这个配置时,Golang插件并没有构建整个项目,而是只构建了包含main方法的单个脚本文件,然后尝试运行它 - 很明显这是行不通的。

如何创建一个等价于 go build && ./executable -args=1 的配置呢?

英文:

I am using the latest (2014-01-03) Golang plugin for IntelliJ - for the first time.

Usually, my terminal workflow is to do go build && ./executable -args=1

So I am attempting to create a launch configuration to do the same thing, I took these actions:

  • Create a "Go Application" configuration
  • Fill in GOPATH/GOROOT environment variable
  • Fill in CLI arguments
  • Because there has to be a file to run, so I chose the one with func main()

Then there is a problem. When I run the configuration, the Golang plugin does not build the project, but instead builds the single script file with main method, then attempt to run it - obviously it does not work.

How to create a configuration equivelent of go build && ./executable -args=1?

答案1

得分: 0

然而,我更喜欢使用支持自动构建、自动代码补全和调试的goclipse。

英文:

However, I prefer to use goclipse which support auto-build, auto code completion and debug.

答案2

得分: 0

请尝试使用官方插件管理器中的最新版本。
如果这不起作用,请通过在这里提交报告来帮助我们识别问题。

此外,我们正在努力更新插件,以提供更好的类型检查、调试、Go AppEngine 支持、改进的格式化程序等等,但是非常感谢任何改进插件的帮助。

希望对您有所帮助。

英文:

Try to use the latest version from the official plugin manager.
If that doesn't work, please help us identify the issue by submitting a report here

Also, we are working hard to update the plugin with better type checks, debugging, go appengine support, improved formatter and much more but any help in improving the plugin is greatly appreciated.

Hope it helps.

huangapple
  • 本文由 发表于 2014年1月4日 14:58:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/20918041.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定