CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
19
Task/Exceptions/Go/exceptions.go
Normal file
19
Task/Exceptions/Go/exceptions.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func foo() {
|
||||
fmt.Println("let's foo...")
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
fmt.Printf("Error: %v\n", err)
|
||||
}
|
||||
}()
|
||||
panic("FAIL!")
|
||||
fmt.Println("there's no point in going on.")
|
||||
}
|
||||
|
||||
func main() {
|
||||
foo()
|
||||
fmt.Println("glad that's over.")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue