in client/local_notwindows.go [25:38]
func newCmd(args []string) *exec.Cmd {
cmd := exec.Command(args[0], args[1:]...)
// Set a process group ID so that later we can kill child processes too. As an
// example, if the command is `go run main.go`, Go will build a binary in a
// temp dir and then execute it. If we simply cmd.Process.Kill() the exec.Command
// then the running binary will not be killed. Only if we make a group and then
// kill the group will child processes be killed.
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
return cmd
}