Earlier quoted context omitted.
Generics are useless when there is no way to integrate them with your rest of the code. As golang has no instanceof or typeof keyword, you practically you cannot use a method that uses multiple types as arguments without having to use the reflect API, just to have an if/else branch on what to do with that argument. The things that I mentioned are from another point of view where language designers and implementers de…
>As golang has no instanceof or typeof keyword, you practically you cannot use a method that uses multiple types as arguments without having to use the reflect API You don't have to use reflection, there are typecasts: "value, ok := arg.(MyType)" You can also switch on a type. How is it different from instanceof in practice?
If item instanceof HouseStruct {}
Elseif item instanceof ContainerStruct {}
With your suggested solution you end up with OOP fatigue and GenericBuildingImplementationStruct which is probably not what golang wanted to embrace with their type system.