在Geany中运行Go代码

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

Running Go in Geany

问题

我正在尝试在Geany中运行Go代码。

不幸的是,当我尝试执行时,出现了以下错误:

./geany_run_script.sh: 5: ./geany_run_script.sh: go: not found

我知道有些帖子说在运行之前必须先编译或构建,但go run命令可以同时编译和运行,所以...

在Geany中如何运行Go代码?

英文:

I am trying to run go code in geany.

Unfortunately I get this error when I try to execute:

./geany_run_script.sh: 5: ./geany_run_script.sh: go: not found

I know some posts say that one must compile or build before running but the go run command compiles and runs at the same time, so ...

How does one run go code in geany?

答案1

得分: 1

解决方法是在Geany选项中转到“构建”>“设置构建命令”,在执行命令部分,写入您的go可执行文件的完整路径,例如/path/to/go/bin/go run "%f"

英文:

The solution is to go to Build>Set Build Commands in the Geany options, under the Execute commands section, write the full path to your go executable, so /path/to/go/bin/go run "%f".

huangapple
  • 本文由 发表于 2013年9月27日 02:29:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/19035917.html
匿名

发表评论

匿名网友

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

确定