Exec and exit code 2

Hey i try to execute a command with golang.
Actualy i have this for execute the command
cmd := exec.Command("iptables", "-A", "INPUT", "-p", "tcp", "-s", data.Ip, "--dport", data.Port, "-j DROP")
err := cmd.Run()
but when i run the script i have a error but the returned command is good (iptables -A INPUT -p tcp -s --dport 25565 -j DROP)
i have error=exit status 2 output=0xcbbb20
Do you have a idea why i have this?

Try separating "-j DROP" into 2 arguments.

1 Like

Perfect thanks men