diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2023-12-01 20:21:03 +0100 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2023-12-01 20:21:03 +0100 |
commit | 9e6837a5fdb672dbf38b1315100a5dac7961b367 (patch) | |
tree | e15fc26250d9a2791e582088f843aa2b6932f9b8 /src/main.zig | |
parent | 57982c29668ffb45fb0b7a574fee34261978453a (diff) |
main: get data and print it
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/main.zig b/src/main.zig index 7cf9729..ba479e9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -9,31 +9,10 @@ pub fn main() !void{ const args = try std.process.argsAlloc(allocator); defer std.process.argsFree(allocator, args); - _ = try weatherFetcher.getData(allocator); + var daily = try weatherFetcher.getDailyData(allocator); + defer daily.deinit(); const stdout = std.io.getStdOut().writer(); try stdout.print("Weather app {s}\n", .{args}); + std.debug.print("{}\n", .{daily.data}); } - -//pub fn main() !void { -// // Prints to stderr (it's a shortcut based on `std.io.getStdErr()`) -// std.debug.print("All your {s} are belong to us.\n", .{"codebase"}); -// -// // stdout is for the actual output of your application, for example if you -// // are implementing gzip, then only the compressed bytes should be sent to -// // stdout, not any debugging messages. -// const stdout_file = std.io.getStdOut().writer(); -// var bw = std.io.bufferedWriter(stdout_file); -// const stdout = bw.writer(); -// -// try stdout.print("Run `zig build test` to run the tests.\n", .{}); -// -// try bw.flush(); // don't forget to flush! -//} -// -//test "simple test" { -// var list = std.ArrayList(i32).init(std.testing.allocator); -// defer list.deinit(); // try commenting this out and see if zig detects the memory leak! -// try list.append(42); -// try std.testing.expectEqual(@as(i32, 42), list.pop()); -//} |