khoi@slrpnk.net to Go programming language discussion@lemmy.ml · 1 year agoShould I use naked return? If not, why? If yes, when?message-squaremessage-square2fedilinkarrow-up16arrow-down10
arrow-up16arrow-down1message-squareShould I use naked return? If not, why? If yes, when?khoi@slrpnk.net to Go programming language discussion@lemmy.ml · 1 year agomessage-square2fedilink
minus-squaresquirmy_wormy@lemmy.worldlinkfedilinkarrow-up5·1 year agoThis says when it’s ok to use them and why it should be limited https://go.dev/tour/basics/7 Personally, I don’t like them. Makes things awkward to read imo
minus-squareck_@discuss.tchncs.delinkfedilinkarrow-up4·1 year agoYeah, I tend to agree, naked returns are hard to read and they don’t really add much in terms of value. I avoid them in my code.
This says when it’s ok to use them and why it should be limited
https://go.dev/tour/basics/7
Personally, I don’t like them. Makes things awkward to read imo
Yeah, I tend to agree, naked returns are hard to read and they don’t really add much in terms of value.
I avoid them in my code.