Skip to content

Commit

Permalink
use exit for panic
Browse files Browse the repository at this point in the history
  • Loading branch information
thatstoasty committed Apr 4, 2024
1 parent 7284a9f commit 45f4507
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions gojo/builtins/errors.mojo
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
fn exit(code: Int):
"""Exits the program with the given exit code via libc.
TODO: Using this in the meantime until Mojo has a built in way to panic/exit.
"""
var status = external_call["exit", Int, Int](code)

from sys import exit

fn panic[T: Stringable](message: T, code: Int = 1):
"""Panics the program with the given message and exit code.
Expand Down

0 comments on commit 45f4507

Please sign in to comment.