This commit is contained in:
Steven Degutis
2012-03-17 12:33:13 -05:00
parent 08bb6db1fa
commit 2674e39b1d
2 changed files with 8 additions and 3 deletions

View File

@@ -1,5 +1,10 @@
package go_koans
func aboutPanics() {
panic("crap")
func divideFourBy(i int) int {
return 4 / i
}
func aboutPanics() {
n := divideFourBy(0)
assert(n == 2) // panics are exceptional errors at runtime
}

View File

@@ -33,7 +33,7 @@ func TestKoans(t *testing.T) {
aboutStructs()
aboutAllocation()
aboutConcurrency()
//aboutPanics()
aboutPanics()
fmt.Printf("\n%c[32;1mYou won life. Good job.\n\n", 27)
}