Russ Cox | 270a22d | 2023-12-05 11:15:03 -0500 | [diff] [blame^] | 1 | --- |
| 2 | title: LearnErrorHandling |
| 3 | --- |
| 4 | |
Sameer Ajmani | cda5605 | 2015-01-09 13:49:30 -0500 | [diff] [blame] | 5 | This page links to resources about error handling in Go. |
| 6 | |
| 7 | ## Getting Started |
| 8 | |
Sean Liao | 3c9c9e1 | 2022-01-22 17:27:16 +0100 | [diff] [blame] | 9 | - Read [Effective Go: Errors](https://go.dev/doc/effective_go#errors) |
mbyd916 | 3418e43 | 2017-09-29 17:17:41 +0800 | [diff] [blame] | 10 | - Code [A Tour of Go: Errors](http://tour.golang.org/methods/19) and do the [exercise](http://tour.golang.org/methods/20) |
Sean Liao | 3c9c9e1 | 2022-01-22 17:27:16 +0100 | [diff] [blame] | 11 | - Study [The Go Programming Language Specification: Errors](https://go.dev/ref/spec#Errors) |
| 12 | - Study [Package errors](https://pkg.go.dev/errors/) |
| 13 | - Study [func fmt.Errorf](https://pkg.go.dev/fmt/#Errorf) |
Sameer Ajmani | cda5605 | 2015-01-09 13:49:30 -0500 | [diff] [blame] | 14 | |
| 15 | ## Standard Practice |
| 16 | |
Sean Liao | 3c9c9e1 | 2022-01-22 17:27:16 +0100 | [diff] [blame] | 17 | - Read [Why does Go not have exceptions?](https://go.dev/doc/faq#exceptions) |
| 18 | - Read [Error handling and Go](https://go.dev/blog/error-handling-and-go) |
Sameer Ajmani | cda5605 | 2015-01-09 13:49:30 -0500 | [diff] [blame] | 19 | - Read [Go by Example: Errors](https://gobyexample.com/errors) |
Sean Liao | 3c9c9e1 | 2022-01-22 17:27:16 +0100 | [diff] [blame] | 20 | - Read [Errors are values](https://go.dev/blog/errors-are-values) |
| 21 | - Read [Working with Errors in Go 1.13](https://go.dev/blog/go1.13-errors) |
Sameer Ajmani | a5dc76b | 2015-01-12 11:23:19 -0500 | [diff] [blame] | 22 | - Read [golang/go/wiki: Errors](Errors) |
Sameer Ajmani | cda5605 | 2015-01-09 13:49:30 -0500 | [diff] [blame] | 23 | |
| 24 | ## Advanced Topics |
| 25 | |
Sean Liao | 3c9c9e1 | 2022-01-22 17:27:16 +0100 | [diff] [blame] | 26 | - Read [Why is my nil error value not equal to nil?](https://go.dev/doc/faq#nil_error) |
Russ Cox | 270a22d | 2023-12-05 11:15:03 -0500 | [diff] [blame^] | 27 | - Read [Defer, Panic, and Recover](https://go.dev/blog/defer-panic-and-recover) |