Andrew Gerrand 12 July 2011 Introduction If you have written any Go code you have probably encountered the built-in error type. Go code uses error values to indicate an abnormal state. For example, the os.Open function returns a non-nil error value when it fails to open a file. func Open(name string) (file *File, err error) The following code uses os.Open to open a file. If an error occurs it call
![Error handling and Go - The Go Programming Language](https://cdn-ak-scissors.b.st-hatena.com/image/square/61955b2029cca886435bd7bb93b949e8f18ae48d/height=288;version=1;width=512/https%3A%2F%2Fgo.dev%2Fdoc%2Fgopher%2Frunningsquare.jpg)