Goland 生成可执行文件

时间:2021-03-26 12:44:06

Goland通过调用go build 生成可执行文件。
默认Goland是可以执行程序,但你找不到可执行文件。
你需要自定义配置文件。


创建go build配置文件
Run kind 选Directory
Directory 选你的main包所在文件夹
Output directory设置与go build -o 不相容,所以不用设置,我们使用-o参数来控制可执行文件的路径以及名字
Working directory保持默认就好
Go tool arguments 就是go build 的参数