In my func I have a variable of Product struct but I have not access to Product struct and I want make a slice of Product from it's variable for example:
test1 := Product{}
....
....
....
test2 := []TypeOf(test1)
how can I do that?
Update: what I want to actually achieve?
I have some structs that want to use in a adapter for gorm.
In my adapter for example I have a FindAll method that need slice of one of my struct.
All my structs is in a package named Domains and I don't want send needed variable from where use(call) FindAll function.
Now I registered all my structs to a Map and fetch them in adapter with struct name but the result is a variable of that struct not type of that struct so I can't make another variable from it or make a slice of that.