[go-nuts] Re: rinn: return if not nil syntactic sugar

2020-08-30 Thread Zakaria bin Haris
Cause the objection for previous error handling is code coverage, the solution is for code coverage tools to desugarize *rinn* syntax. The objective to minimize error handling "noise" from human eyes. On Monday, August 31, 2020 at 9:29:44 AM UTC+7 Zakaria bin Haris wrote: > For co

[go-nuts] Re: rinn: return if not nil syntactic sugar

2020-08-30 Thread Zakaria bin Haris
For completeness if the function is something like: func x() (data *Data, err error) { } then *rinn* should be smart enough to assign error to err variable and just do return instead return err On Monday, August 31, 2020 at 9:19:48 AM UTC+7 Zakaria bin Haris wrote: > Sorry, I mean ret

[go-nuts] Re: rin: return if nil syntactic sugar

2020-08-30 Thread Zakaria bin Haris
Sorry, I mean return if not nil, so it should be *rinn* or please find some better keyword for this :^). On Monday, August 31, 2020 at 9:15:31 AM UTC+7 Zakaria bin Haris wrote: > Hi, gophers! > > Idk if this has been proposed or discussed before. > > Given the last error handli

[go-nuts] rin: return if nil syntactic sugar

2020-08-30 Thread Zakaria bin Haris
Hi, gophers! Idk if this has been proposed or discussed before. Given the last error handling abbreviation proposal is rejected. How about some simple syntactic sugar like this: *rin* Something() Which is just a sugar for: if err := Something(); err != nil { return err } To make it