Conversation
8e2c45a to
ecbffcb
Compare
|
@Maschga right now we're still creating one implementation wrapper per interface and instance, for example: type decorateVehicleChargeStateImpl struct {
chargeState func() (api.ChargeStatus, error)
}
func (impl *decorateVehicleChargeStateImpl) Status() (api.ChargeStatus, error) {
return impl.chargeState()
}It would be nice if we could make them unique and global instead of repeating the code. I have started an We also need a single global function per interface for creating the interface from function and decorator like https://github.com/evcc-io/evcc/pull/28576/changes#diff-efd8c72d5ba5a9182a27e6f1f9827a9a8dc11703de2c51d5fdaa38d5f9fedf25R7-R9. Would be great if you could look into this. Maybe AI could even help? |
Depends on #28565
Experiment to further simplify decorating interfaces while waiting for golang/go#47487