I want to run a binary file with flags. If i directly run the binary it will be like following inside a golang program.
./test --flag1 arg1 --flag2 arg2
I was trying to run by the use of os.exec
.
code: reslt ,err:= exec.Command("./test","--flag1", "arg1", "--flag2", "arg2").Output
It is giving error:
Exit status 2
Can anyone help on this?