//go:build windows package compose import ( "errors" "os/exec" "syscall" "time" ) const finalTerminationBound = 2 * time.Second const createNewProcessGroup = 0x00000200 func configureProcess(command *exec.Cmd) { command.SysProcAttr = &syscall.SysProcAttr{CreationFlags: createNewProcessGroup} } func terminateProcess(command *exec.Cmd, done <-chan error) error { if command.Process == nil { return nil } _ = command.Process.Kill() select { case <-done: return nil case <-time.After(finalTerminationBound): return errors.New("Docker command could not be reaped") } }