On the other side maybe confusion on the part of code writers if they use
pointer receiver because of consistency instead of needing it?

Am Mi., 23. Jan. 2019 um 00:01 Uhr schrieb Ian Lance Taylor <i...@golang.org
>:

> On Tue, Jan 22, 2019 at 1:59 PM Xinhu Liu <xinhu.li...@gmail.com> wrote:
> >
> > In "A Tour of Go" I read:
> >
> >> In general, all methods on a given type should have either value or
> pointer receivers, but not a mixture of both.
> >
> >
> > But why not?
> >
> > Methods having value receiver can be called by both value type and
> pointer type. The same is for methods having pointer receiver.
> >
> > What is disadvantages of mixing value and pointer receiver?
>
> Confusion on the part of the code reader.
>
> Ian
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to