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

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?

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.

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