argument to exec.Command looks like a shell command, but a program name or path are expected (SA1005)
Is there any replacement for running shell commands?
It must be exec.Command("df", "-h") If I'm not mistaking
so I have to split flags from user input... thank you so much
you have to separate each field: exec.Command("program", "-arg1", "value1", "-arg2", "value2")
oh thanks for detail by the way I found a lib for parsing shell commands on github, it seems it would be useful for those who wants to run commands from user input
Обсуждают сегодня