Re: [go-nuts] Re: Interface Fields

2021-01-12 Thread Dave Protasowski
t(x.ID) > Print(y.ID) > ``` > I hope it helps. > > Henry > On Wednesday, January 13, 2021 at 8:34:00 AM UTC+7 Dave Protasowski wrote: > >> I'm doing some due-diligence and wondering if there's any old topics >> about extending interfaces to support field set

[go-nuts] Interface Fields

2021-01-12 Thread Dave Protasowski
I'm doing some due-diligence and wondering if there's any old topics about extending interfaces to support field sets. ie. type WithID interface { ID string } type X struct { ID string } type Y struct { ID string } func PrintID(item WithID) { fmt.Println(item.ID) } In the above the PrintID