The code in :
wire-0.4.0/internal/wire/parse.go:731 gives the error message "second return type is %s; must be func()"
if there are >3 returns then this fails with "too many return values".
I want to initialise multiple services from this call - why is this problematic?
(I also have some legacy code that works by side-effect and have had to create a fake object just to allow a no-return provider to be called - would be good if wire could be more flexible and give a warning for bad practice rather than a hard failure here)
wire.go:
func Initialise() (thingA, thingB, thingC, thingD error) {
wire.Build(thingAProvider, thingBProvider, thingCProvider, thingDProvider)
return thingA{}, thingB{}, thingC{}, thingD{}, nill
}
gives error:
"too many return values"
Thinking on this there is a workaround - will test tomorrow - creating many Initialise() methods - but now my code has to call lots of generated methods rather than a single call - also if we have to create one-for-one unless the dependency graph is deep this what's the gain over manual implementation? I'm using wire to eliminate boilerplate.
Only been using this for 1 day so this could all be wrong.
Thanks for taking a look at this,
Alex