helper: move test sample data out of direct

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-10-07 22:51:08 +09:00
parent 55a5b6f242
commit 3c5185d770
3 changed files with 31 additions and 24 deletions

View File

@@ -62,11 +62,11 @@ func (h *direct) Wait() error {
if h.Cmd.Process == nil {
return errors.New("exec: not started")
}
defer h.p.mustClosePipes()
if h.Cmd.ProcessState != nil {
return errors.New("exec: Wait was already called")
}
defer h.p.mustClosePipes()
return h.Cmd.Wait()
}