Skip to content

Commit 9d38d70

Browse files
committed
Update withslice.go
1 parent 566e414 commit 9d38d70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/basic/cmdexec/withslice.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmdexec
22

33
import (
4+
"fmt"
45
"os/exec"
56

67
"github.com/devlights/gomy/output"
@@ -30,8 +31,7 @@ func WithSlice() error {
3031

3132
out, err = cmd.CombinedOutput()
3233
if err != nil {
33-
output.Stdoutf("[cmd error]", "%s", out)
34-
return err
34+
return fmt.Errorf("%w (%s)", err, out)
3535
}
3636

3737
output.Stdoutf("[cmd]", "%s", out)

0 commit comments

Comments
 (0)