TIL in Golang: Interfaces & Errors
by @0xi4o
This one was a bit hard to get my head around. There was one common exercise for both of these concepts. But while working on the exercise itself, I realized how important these concepts were, especially if I'm working on projects or public packages.
So there is no exceptions for error handling in Go. Instead errors are values of an interface called `error`. In order to learn errors, I had to learn interfaces.
I still need more practice on these two topics because I feel my understanding of them is a bit shaky. Anyways, here's my solution:
*SPOILERS*
https://exercism.org/tracks/go/exercises/the-farm/solutions/ilango
So there is no exceptions for error handling in Go. Instead errors are values of an interface called `error`. In order to learn errors, I had to learn interfaces.
I still need more practice on these two topics because I feel my understanding of them is a bit shaky. Anyways, here's my solution:
*SPOILERS*
https://exercism.org/tracks/go/exercises/the-farm/solutions/ilango