In go code, there is a method to say:
init() {
service = &Service {
updater: updaterVariable
}
}
updater field has type of *lib.Updater
I am trying to override one method of lib.Updater
and pass it to &Service
in init method (as above).
What I am doing is:
type ModifiedUpdater struct {
lib.Updater
}
//overridden method
func (f *ModifiedUpdater) Update(...) {
//implementation
}
When I initialize the modified updater and try to pass to Service, I am getting something similar to this "Cannot use variable of *ModifiedUpdater as *Updater"
The way I am trying to assign:
init() {
modifiedUpd := &ModifiedUpdater{*lib.Updater{conn}}
service = &Service {
updater: modifiedUpd
}
}
How can I fix it or what approach should I take? Thank you.