if a method only defined for a pointer receiver, the compiler will add "*" before the caller silently.
Why pointer receiver? Try to change the value of a member. You will know the difference. On Sunday, May 7, 2017 at 6:37:59 PM UTC+8, mhh...@gmail.com wrote: > > yes, sorry you scratched your head > > https://play.golang.org/p/Gg6Euyvsw6 > > this example shows that it is possible to do all the things. > hth. > > I m curious to know more about other questions. > Maybe they are not good idea, or not technically achievable. > Just curious. > > > On Sunday, May 7, 2017 at 2:55:58 AM UTC+2, Ian Lance Taylor wrote: >> >> On Sat, May 6, 2017 at 3:39 AM, <mhh...@gmail.com> wrote: >> > >> > Question about the receiver of a func. >> > >> > It can be defined as star/no star, and consumed as star/nostar. >> > >> > The understanding i have so far is, >> > it let the developer define the memory model he d like to use. >> > >> > It leads to cases such as >> > - define start/nostar on a type >> > - consume a stared type as a value >> > - consume a value type as a pointer >> >> You are not permitted to define a method on a named type defines as a >> pointer type, so I don't understand your cases. Can you describe them >> using actual Go code rather than words? >> >> 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.