1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
//go:build windows
// +build windows
package pipe
// runInOwnProcessGroup is not supported on Windows.
func (s *commandStage) runInOwnProcessGroup() {}
// kill is called to kill the process if the context expires. `err` is
// the corresponding value of `Context.Err()`.
func (s *commandStage) kill(err error) {
select {
case <-s.done:
// Process has ended; no need to kill it again.
return
default:
}
// Record the `ctx.Err()`, which will be used as the error result
// for this stage.
s.ctxErr.Store(err)
s.cmd.Process.Kill()
}
|