check_os simplification

main
Jordan Orelli 4 years ago
parent 1662888df8
commit 1d134ae04b

@ -2,15 +2,10 @@ const std = @import("std");
const builtin = @import("builtin"); const builtin = @import("builtin");
pub fn main() !void { pub fn main() !void {
switch (builtin.os.tag) { const name = switch (builtin.os.tag) {
.windows => { .windows => "windows",
std.debug.print("hello windows OS: {}\n", .{builtin.os.tag}); .linux => "linux",
}, else => "mystery",
.linux => { };
std.debug.print("hello linux-based OS: {}\n", .{builtin.os.tag}); std.debug.print("hello {}\n", .{name});
},
else => {
std.debug.print("hello mystery OS: {}\n", .{builtin.os.tag});
},
}
} }

Loading…
Cancel
Save