Re: [go-nuts] Re: panicOn(err) error handling

2022-02-23 Thread 'Axel Wagner' via golang-nuts
On Wed, Feb 23, 2022 at 10:50 AM Brian Candler wrote: > Of course, you should write your own programs which work in the way which > suits you best. > > If I understand your original post correctly, you are making two proposals: > > 1. Modifying the language to have some sort of shortcut for "if

[go-nuts] Re: panicOn(err) error handling

2022-02-23 Thread Brian Candler
Of course, you should write your own programs which work in the way which suits you best. If I understand your original post correctly, you are making two proposals: 1. Modifying the language to have some sort of shortcut for "if err != nil { panic(err) }" 2. Modifying Go documentation to tell

[go-nuts] Re: panicOn(err) error handling

2022-02-23 Thread Jason E. Aten
On Wednesday, February 23, 2022 at 12:33:55 AM UTC-6 Brian Candler wrote: > I don't think it's a good idea to recommend to beginners that they should > write programs that crash. Neither is teaching them a pattern that they > will have to discard as soon as they write real programs. Au

[go-nuts] Re: panicOn(err) error handling

2022-02-22 Thread Brian Candler
I don't think it's a good idea to recommend to beginners that they should write programs that crash. Neither is teaching them a pattern that they will have to discard as soon as they write real programs. Panic doesn't generates user-friendly error messages, it generates stacktraces for a