Skip to content

os/exec: include stderr in ExitError #11381

@bradfitz

Description

@bradfitz

We should include Stderr in ExitError, so you can write code like:

stdout, err := exec.Command("foo", "fail").Output()
if err != nil {
     log.Fatalf("foo command failed: %v: %s", err, err.(*exec.ExitError).Stderr)
}

Sketch without tests at:
https://go-review.googlesource.com/11415

/cc @rsc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions