Suppose I have an interface :
type Module interface {
Run(moduleInput x) error // x is the type of moduleInput
}
where each "module" will fulfill the Run function. However, the moduleInput isn't a single struct - it should be able to accept any struct but only allowed structs, i.e not interface{} (say, only moduleAInputs and moduleBInputs struct).
Ideally the Run function for each module would have the type of moduleXInput where X is an example module.
Is it possible to constrain the type of moduleInput with generics or otherwise?