File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -464,10 +464,9 @@ is less clear than:
464
464
func (f *Foo) Location () (lat, long float64 , err error )
465
465
` ` `
466
466
467
- Naked returns are okay if the function is a handful of lines. Once it's a medium
468
- sized function, be explicit with your return values. Corollary: it's not worth it
469
- to name result parameters just because it enables you to use naked returns.
470
- Clarity of docs is always more important than saving a line or two in your function.
467
+ Avoid using naked returns. Corollary: do not name result parameters just
468
+ because it enables you to use naked returns. Clarity of docs is always more
469
+ important than saving a line or two in your function.
471
470
472
471
Finally, in some cases you need to name a result parameter in order to change
473
472
it in a deferred closure. That is always OK.
You can’t perform that action at this time.
0 commit comments