Re: [go-nuts] Struct overloading method issue

2017-09-03 Thread Tong Sun
On Sunday, September 3, 2017 at 1:51:54 AM UTC-4, Jesse McNelis wrote: > > On Sat, Sep 2, 2017 at 12:50 AM, BeaT Adrian > wrote: > > Hello, I ran into a strange scenario and I wanted to know if there is a > > better solution for it > > > > type A struct{} > > > > func (a *A) private() {}

Re: [go-nuts] Struct overloading method issue

2017-09-02 Thread Jesse McNelis
On Sat, Sep 2, 2017 at 12:50 AM, BeaT Adrian wrote: > Hello, I ran into a strange scenario and I wanted to know if there is a > better solution for it > > type A struct{} > > func (a *A) private() {} > func (a *A) Public() { >a.private() > } > > type B struct {A} > > func (b *B) private() {} >

[go-nuts] Struct overloading method issue

2017-09-01 Thread BeaT Adrian
Hello, I ran into a strange scenario and I wanted to know if there is a better solution for it type A struct{} func (a *A) private() {} func (a *A) Public() { a.private() } type B struct {A} func (b *B) private() {} bi := B{} b.Public() //calls the A.Private I just want to rewrite a sma