Skip to content

Commit d280650

Browse files
authored
Merge pull request #129 from xushiwei/q
osx: Check
2 parents 67b52af + 329f8d9 commit d280650

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

osx/osx.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ func Fatal(args ...any) {
3333
os.Exit(1)
3434
}
3535

36+
// Check is a helper function to check the error.
37+
func Check(err error) {
38+
if err != nil {
39+
fmt.Fprintln(os.Stderr, err)
40+
os.Exit(1)
41+
}
42+
}
43+
3644
// ----------------------------------------------------------------------------
3745

3846
// LineIter is an iterator that reads lines from a reader.

0 commit comments

Comments
 (0)