panic and defer notes

This commit is contained in:
Mark McGranaghan 2012-10-12 05:33:43 -07:00
parent 68447b15a6
commit 58b809110d
2 changed files with 4 additions and 0 deletions

View File

@ -14,3 +14,5 @@ func main() {
defer second()
first()
}
// todo: review http://blog.golang.org/2010/08/defer-panic-and-recover.html

View File

@ -1,9 +1,11 @@
// A `panic` means something went unexpectedly wrong.
// Mostly we use it to fail fast on errors that
// shouldn't occur during normal operation.
package main
func main() {
// We'll use panic throught this book to check for
// unexpected errors. This is the only program in the
// book designed to panic.