【发布时间】:2016-08-30 18:20:09
【问题描述】:
我正在尝试将参数传递给 exec.Command。该参数的部分是一个变量。
a := fileName
exec.Command("command", "/path/to/"a).Output()
我不确定如何解决这个问题,我想我需要在通过它之前完全形成论点,但我也在努力解决这个问题。我不知道该怎么做:
a := fileName
arg := "/path/to/"a
exec.Command("command", arg).Output()
【问题讨论】: