- Why generalize our set implementation
- Allows code reuse with other element types
- Using the empty interface type
- No restrictions, satisfied by every specifc type
- Allows code reuse
- Common solution before Go 1.18
- Element types can be mixed (often not wanted)
- No guarantees by the compiler, requires type assertions at runtime
isensee-bastian / set-interface Goto Github PK
View Code? Open in Web Editor NEWTutorial code for my video Generics Part 2: Using the empty Interface instead
Home Page: https://youtu.be/ASUf380d974
License: MIT License