I love the way Golang makes us handle errors.
Instead of raising and throwing exceptions, like many other programming languages, Go treats errors as first-class citizens and lets us return them from the function, making them an integral part of the program’s flow.
I prefer this over traditional exceptions because it shifts our perspective from thinking of it as an odd, infrequent event to something we need to be aware of at every step and be in a position to handle gracefully.
By returning errors from the functions, we can also let them travel upwards through parent functions, reaching the appropriate handler and giving the code the necessary clarity and predictability.
Personally, this makes the code more robust as it removes the possibility of silent failures, enabling us to attain high availability for our services.