DO
type ModuleConfigInterface interface{}и, как я понял, две структуры
type Module1Config struct {
ModuleConfigInterface
a string
b int
}
type Module2Config struct {
ModuleConfigInterface
c bool
}Size: a a a
DO
type ModuleConfigInterface interface{}type Module1Config struct {
ModuleConfigInterface
a string
b int
}
type Module2Config struct {
ModuleConfigInterface
c bool
}АП
ЕО
Configure вообще отпилитьАП
type ModuleConfigInterface interface{}type Module1Config struct {
ModuleConfigInterface
a string
b int
}
type Module2Config struct {
ModuleConfigInterface
c bool
}ЕО
DO
ЕО
DO
АП
interface{} он же пустой контейнер в который можно положить любой тип, а есть тип интерфейсDO
ЕО
ЕО
DO
DO
АП
func NewModule1(cfg *Module1Config) *Module1 {
return &Module1{
cfg: cfg,
}
}ЕО
ЕО
func NewModule1(cfg *Module1Config) *Module1 {
return &Module1{
cfg: cfg,
}
}АП
DO
ЕО