panic and defer notes
This commit is contained in:
parent
68447b15a6
commit
58b809110d
@ -14,3 +14,5 @@ func main() {
|
|||||||
defer second()
|
defer second()
|
||||||
first()
|
first()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo: review http://blog.golang.org/2010/08/defer-panic-and-recover.html
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
// A `panic` means something went unexpectedly wrong.
|
// A `panic` means something went unexpectedly wrong.
|
||||||
// Mostly we use it to fail fast on errors that
|
// Mostly we use it to fail fast on errors that
|
||||||
// shouldn't occur during normal operation.
|
// shouldn't occur during normal operation.
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
// We'll use panic throught this book to check for
|
// We'll use panic throught this book to check for
|
||||||
// unexpected errors. This is the only program in the
|
// unexpected errors. This is the only program in the
|
||||||
// book designed to panic.
|
// book designed to panic.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user