Panic and Recover - Go Lang Practical Programming Tutorial p.21

Опубликовано: 28 Сентябрь 2024
на канале: sentdex
29,425
474

The idea of panic is to halt the program and start to panic. This will stop the running function and run all of the deferred functions from the panicking function. The recover function lets you recover from a panicking goroutine. To recover a panicking goroutine, you would need to use recover from within one of the deferred functions of that goroutine.

Text tutorials and sample code: https://pythonprogramming.net/go/
  / sentdex  
  / pythonprogramming.net  
https://plus.google.com/+sentdex