[go-nuts] Practical use cases of recover in golang

2022-10-09 Thread cg-guy
Hi Team, Whatever I have been worked so far with golang,I did not use recover() function . Curious to know if anyone using recover in production code and can you please the scenarios where it is used. Thanks -- You received this message because you are subscribed to the Google Groups "gol

Re: [go-nuts] Practical use cases of recover in golang

2022-10-09 Thread Ian Lance Taylor
On Sun, Oct 9, 2022 at 2:17 PM cg-guy wrote: > > Whatever I have been worked so far with golang,I did not use recover() > function . > Curious to know if anyone using recover in production code and can you please > the scenarios where it is used. You may want to look at how it is used in the Go

Re: [go-nuts] Practical use cases of recover in golang

2022-10-09 Thread Kurtis Rader
The Elvish shell uses panic capture to ensure an interactive Elvish shell that paniced is replaced by a recovery shell. While still outputting important information about the panic. See this code

Re: [go-nuts] Practical use cases of recover in golang

2022-10-09 Thread Henry
You may want to make your app more robust by handling panic in the topmost layer of your application. With many people working on the code and various external dependencies, it is often impractical to ensure none of the code panics. This is where recover comes in. On Monday, October 10, 2022 at

Re: [go-nuts] Practical use cases of recover in golang

2022-10-10 Thread Brian Candler
On Monday, 10 October 2022 at 06:21:48 UTC+1 Henry wrote: > You may want to make your app more robust by handling panic in the topmost > layer of your application. With many people working on the code and various > external dependencies, it is often impractical to ensure none of the code > pani