Young black engineer striving for excellence! Primarily focused in back-end development, with interests in cloud development & modern dev-ops (docker & kubernetes). @netflix
Wow, yes, I think I tried to use polymorphism on the wrong way. The problem I see with that implementation is the elements in the slice can be another type that implements the same interface.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Creative approach!
Another way is to type the slices as a list of Elements.
play.golang.org/p/qdbRJ1Kq_Kq
Wow, yes, I think I tried to use polymorphism on the wrong way. The problem I see with that implementation is the elements in the slice can be another type that implements the same interface.