Advanced Error Handling in Golang
If you have ever written any Golang code you have probably noticed the built-in error type interface. Golang uses error values to indicate an abnormal state. The error type represents any value that can describe itself as a string. Here is the interface’s declaration: type error interface { Error() string } The most commonly-used error implementation is the errors package’s implementation that allows you to instantiate errors by using the following code snippet:...