so I have the code. but gorm not recognize the structure as S2 in your example and I generates the error specified above.
there any way to make a function where the return is not interface {}, but it dynamic? I mean according to the selected case returns me that structure and not an interface {}