GoWSL icon indicating copy to clipboard operation
GoWSL copied to clipboard

Cmd does not allow Wait to be called multiple times

Open oneirocosm opened this issue 1 year ago • 0 comments

In the function definition of Wait for the Cmd struct, the finished boolean prevents Wait from being called more than once

if c.finished {
	return errors.New("Wait was already called")
}
c.finished = true

state, err := c.Process.Wait()

This behavior is different from exec.Cmd where Wait can be called multiple times. Allowing this makes certain concurrent tasks easier to synchronize.

oneirocosm avatar Oct 01 '24 20:10 oneirocosm