2014-01-04 06:58

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

  • intellij-idea

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?

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享