Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmd does not allow Wait to be called multiple times #121

Open
oneirocosm opened this issue Oct 1, 2024 · 0 comments
Open

Cmd does not allow Wait to be called multiple times #121

oneirocosm opened this issue Oct 1, 2024 · 0 comments

Comments

@oneirocosm
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant