I’ve the next perform which works:
bundle foremost
sort CISettings interface {
Clone() CISettings
Merge(different CISettings)
}
sort Settings struct{}
func (s *Settings) Clone() CISettings {
return &Settings{}
}
func (s *Settings) Merge(different CISettings) {
}
func ParseCISettings[T CISettings](settings T) error {
sett := settings.Clone()
settings.Merge(sett)
return nil
}
func foremost() {
sett := Settings{}
ParseCISettings[*Settings](&sett)
}
I’ve hassle discovering out why a signature the place I return the settings
doesn’t work:
ParseCISettings[T CISettings](settings T, err error)
I’m not grocking what the compiler trys to inform me. If I make worth receivers it really works, however thats not how Merge
must be applied, it wants a pointer receiver.