Skip to content

os/exec: documentation implies that Cmd can be reused after Start, but it can't #76265

@spenczar

Description

@spenczar

Go version

1.25

Output of go env in your module/workspace:

n/a

What did you do?

Read the go doc on os/exec.Cmd https://pkg.go.dev/os/exec#Cmd

What did you see happen?

I read the line

A Cmd cannot be reused after calling its Cmd.Run, Cmd.Output or Cmd.CombinedOutput methods.

What did you expect to see?

I expected that this means it can be resued after calling other methods like Start, but no - the truth is that Start is the method that blocks reuse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions