On Sun, Jan 31, 2021 at 6:01 PM Amnon <amno...@gmail.com> wrote:
> If you take the
> https://play.golang.org/p/L8z2Q_F_fi3
>
> and change the line 18
> from
> func foo() (err error) {
>
> to
> func foo() error {
>
> The code will continue to compile.

That's again the case of "making the return variable unnamed and declaring a
new, different variable of the same name in the same scope".

The fact that the above is in your example achieved simply by deleting
the text of the name of the named return variable is not relevant to
what I wrote. That's about the semantics. IOW, redirecting the
resolution of the named return variable to a different, non return
variable, which in your example `err` becomes.

I hope it's clear now. Howgh.

-- 
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/CAA40n-XHGCSffSu7Q8rBbudOR_Mt%2BdW%2BoCfxgLfLybYvQ_zrjQ%40mail.gmail.com.

Reply via email to