Original post

Hi All,

!Newbie Alert!
I have been struggling to figure out this for sometime. I am not sure if this is the right approach to do in golang or not.

main.go:

https://play.golang.org/p/Ej3lbIEqSEn

helper.go @ modules/helper.go … which is getting imported in main.go:

https://play.golang.org/p/datdSfrIyXP


Error:

cannot use n1 (type []modules.Info) as type Infoer in assignment:
[]modules.Info does not implement Infoer (missing GetName method)

I understand why error is coming. I am not able to come up with a solution to it.

Any help would be highly appreciated.

Thanks!

for _, i := range n1 {
   fmt.Println(i.GetName())
}