mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
13 lines
258 B
Zig
13 lines
258 B
Zig
const print = @import("std").debug.print;
|
|
pub fn main() void {
|
|
const optional_number: ?i32 = null;
|
|
|
|
if (optional_number) |number| {
|
|
print("got number: {}\n", .{number});
|
|
} else {
|
|
print("it's null\n", .{});
|
|
}
|
|
}
|
|
|
|
// exe=succeed
|