On 2020-08-31 03:34, Ian Lance Taylor wrote: >> 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 worth the new keyword make it so that: >> >> rin v := Something() >> >> equals to: >> >> v, err := Something() >> if err != nil { >> return err >> } > This is similar to the check/handle design draft, without the handle. > You may want to take a look at https://golang.org/issue/40432. > Thanks.
I am using flutter and so Dart for the frontend right now, and I have come to a conclusion that is related but perhaps beyond magical. It is my opinion that having additional syntax simply for syntactic sugar reasons offers little benefit but pointless cognitive load when reading code. I now remove syntactic sugar in Dart like => and ... in my codebases. As the full syntax does the same thing but offers greater functionality, I see negatives with negligible benefit in any case. Especially when there is the potential for code readers to switch from backend to frontend and not necessarily being masters in both languages. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/d7a23054-25d5-5cb3-2fd1-33a310bf4917%40gmail.com.