DEV Community

Discussion on: Using code generation to survive without generics in Go

Collapse
 
paradoxe profile image
Mohamed Karnichi

Hi,
Nice article.
You can save few LOC by making the wrapped list field anonymous. This way you can leverage embedded fields and methods promotion. So you will not have to redeclare the Len method and skip the "list" field in your method calls.