Errors

Errors handling in Golang

Go does not have an Exception handling model as most of the main stream languages. However, it uses the error interface type as the return type for any error that is going to be returned from a function or method: type error interface { Error() string } It is an interface type. An error variable represents any value that can describe itself as a string. The most commonly-used error implementation is in the errors package.
Tags# , ,