Skip to content

Commit 5832c3b

Browse files
committed
os: add ExitCode() method to ProcessState
1 parent 48c7973 commit 5832c3b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/os/exec_plan9.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,7 @@ func (p *ProcessState) String() string {
136136
}
137137
return "exit status: " + p.status.Msg
138138
}
139+
140+
func (p *ProcessState) ExitCode() int {
141+
return p.status.ExitStatus()
142+
}

src/os/exec_posix.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,7 @@ func (p *ProcessState) String() string {
106106
}
107107
return res
108108
}
109+
110+
func (p *ProcessState) ExitCode() int {
111+
return p.status.ExitStatus()
112+
}

0 commit comments

Comments
 (0)