Code review request
Well, as part of Advent of Code, I decided to give Zig a try...never touched it before.
So far, I'm enjoying the language quite a lot, but there are lot of things I still don't get and starting to get annoyed by the compiler :)
I'll be asking you to do me a favor and review the following utilities library I started to build. This should already solve some of my current questions and I don't want to go too deep for now.
https://github.com/blfuentes/AdventOfCode_AllYears/blob/main/AdventOfCode_2026_Zig/src/utilities.zig
The library for now, contains a couple of helpers, one to read the content file as a single line or as multiline. Another one is for downloading the content using a http request.
My questions:
- can I basically use "always" the same allocator (`init.gpa` )? or what is the common rule about what can be used as allocator
- what requires defer in which form?
- error handling... starting to understand it, still confused about if I will end nesting 3-4 function calls handling the errors or how to assume something shouldn't fail so I don't need to catch the error.
Any other feedback about my code is welcome :)