June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package panic import ( "fmt" "strconv" ) // Panic panics with a divide by zero func Panic() { zero, err := strconv.ParseInt("0", 10, 64) if err != nil { panic(err) } a := 1 / zero fmt.Println("we'll never get here", a) } // Catcher calls Panic func Catcher() { defer func() { if r := recover(); r != nil { fmt.Println("panic occurred:", r) } }() Panic() }
Read now
Unlock full access