【发布时间】:2018-09-27 00:39:15
【问题描述】:
在我问这个问题之前,我需要道歉,我知道在代码中以编程方式运行这种东西是愚蠢的,应该转移到 makefile 中 - 但管理层希望这项工作的所有内容都在二进制文件中,所以,酷.. .
我需要知道如何 cd 到一个目录,然后运行:
go fmt ./...
我找到了诸如 exec 之类的东西......但是当我需要运行命令时,问题似乎是专门寻找要使用的文件。
有人做过吗?有我的例子吗?
【问题讨论】:
-
I have found stuff like exec, etc... but the problem there is that seems to look specifically for files to work with, when I need to run a command.什么? -
我猜你想像系统命令一样运行你的二进制文件?
标签: go