zig/test/cases/errors.1.zig
2024-03-19 16:18:18 -07:00

19 lines
236 B
Zig

const std = @import("std");
pub fn main() void {
foo() catch print();
}
fn foo() anyerror!void {
return error.Test;
}
fn print() void {
_ = std.posix.write(1, "Hello, World!\n") catch {};
}
// run
//
// Hello, World!
//