November 2017
Intermediate to advanced
670 pages
17h 35m
English
Another alternative would be to use the empty interface like so:
type Object interface{}type Collection []Objectfunc (list Collection) Contains(e string) bool { for _, t := range list { if t == e { return true } } return false}
However, reflection or typecasting would be required and that would again adversely affect the performance.