//go:build !unix && !windows package tools import ( "os" "os/exec" "syscall" ) // shellProgram is a guess on a platform this package does not know. func shellProgram() string { return "/bin/sh" } // shellArgs assumes a Bourne-style shell. func shellArgs(command string) []string { return []string{"-c", command} } // childAttributes asks for nothing on a platform without process groups. func childAttributes(*exec.Cmd, string) *syscall.SysProcAttr { return nil } // loneProcess is a command with nothing grouping what it started. type loneProcess struct{ process *os.Process } // newGroup has no group to offer. func newGroup(process *os.Process) group { return loneProcess{process: process} } // kill stops the process alone. // // Anything it started keeps running, and if that child holds the output pipe // the run will not report itself finished until WaitDelay expires. That is the // backstop rather than the intent; a platform-specific way to end a whole // process tree would be the real answer here. func (g loneProcess) kill() { _ = g.process.Kill() } func (loneProcess) release() {}