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

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/
https://twitter.com/sentdex
https://www.facebook.com/pythonprogramming.net/
https://plus.google.com/+sentdex

Comments

Govardhan Hegde Kota says:

you teach nicely

Joydeep Mukherjee says:

I want to know how do you learn new programming languages, obviously i am gonna follow your tutorials but i just want to know how you got hooked up with Go?

Michi Lo says:

I was wondering for a few parts now: What is playing in that monitor in the background of your facecam video?
It looks like GTA, but nobody is playing…

EDIT: Is this Python plays GTA V? That would explain things…

Vincent de Jong says:

I still have no audio on your latest video’s, except for the S2000 MSR video. All other video’s on YouTube are fine. It’s really just your latest video’s. My audio isn’t muted or something, it’s specificly these video’s.
-edit- after searching for the last video with sound, I couldn’t find any other than the video about the S2000 MSR. Some time ago I said the same thing, but then I had sound until about video’s in the GTA series. This is so weird.

Rajeev Warrier says:

Hey Harrison, After this tutorial series will you go on to teach web development in Go? I love your tutorials!

Rolando Ariaga says:

Can I use Python to make mobile Apps for iOs?

asiddiqi123 says:

Go sentdex()
GO fmt.Println(“go!”)

Ice blast Grey says:

What ? No 720p or 480p quality ?

Abeltensor says:

You could defer wg.Done in the main func since wg is globally defined. Though actually that would probably error out. Generally when you want to defer multiple functions the way to do it is to build a closure and just defer them in that.

Something like defer func () { wg.Done() cleanup()}() would work in this case. You can embed wg.Done in cleanup as well since it runs when the go-routines panic.

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours