khoi@slrpnk.net to Go programming language discussion · 1 year agoShould I use naked return? If not, why? If yes, when?message-squaremessage-square2fedilinkarrow-up17arrow-down10
arrow-up17arrow-down1message-squareShould I use naked return? If not, why? If yes, when?khoi@slrpnk.net to Go programming language discussion · 1 year agomessage-square2fedilink
minus-squaresquirmy_wormy@lemmy.worldlinkfedilinkarrow-up6·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.