How to compile Google Go bin with IntelliJ

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

How to compile Google Go bin with IntelliJ

问题

我开始学习Go,并在IntelliJ上安装了Go插件。我成功编译和运行了一些非常简单的代码片段。然而,我在bin文件夹中找不到任何二进制文件,而编译器运行以下命令来执行应用程序:

C:/Go/bin/go.exe run E:/IntelliJ/untitled/src/myApp.go

如何获取我编译代码的二进制文件?

英文:

I have started to learn Go and I have installed Go plugin on IntelliJ I have compiled and run sucessful some really simple code pieces. However I don't find any bin file in the bin folder, and the compiler runs this command to execute the app

C:/Go/bin/go.exe run E:/IntelliJ/untitled/src/myApp.go

How to get the binary of my compiled code?

答案1

得分: 1

你需要使用go build命令,go run只是在某个地方创建一个临时文件并执行它,然后删除它。

英文:

You need to use go build, go run simply creates a temporary file somewhere and executes it then deletes it.

答案2

得分: 0

你只需要在你的运行/调试配置中指定output目录,例如

E:\IntelliJ\untitled\.idea\output

英文:

You simply need to specify output dir in your run/debug configuration like

E:\IntelliJ\untitled\.idea\output

huangapple
  • 本文由 发表于 2014年6月15日 19:26:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/24229114.html
匿名

发表评论

匿名网友

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

确定