my problem is I’m trying to make a gin-api rest in gonic with 15 tables.
Create the model layer, the layer repository and the web layer.
But I want to simplify the layer to a single generic repository file.
The idea initially was through a chain Reflect and draw a structura the selected model and make operations corresponding database, for this example is being used gorm.
But in doing so the structures are as interface {} and when passing gorm operations generates the following message:
unsupported destination, slice or struct Should be.
I want a suggestion or help to simplify the web layers and repository.
The repository is in the following url, I do not copy code because the project is large.