Update Provider.Out to be a slice of provided types, and keep track
of the provided concrete type in ProviderSet.providerMap, to more
clearly model-named struct providers (which provide both the struct
type and a pointer to the struct type).
Fixesgoogle/go-cloud#325.
* Add wire.InterfaceValue, required instead of wire.Value if the value is an interface value.
* Update guestbook sample to use InterfaceValue where appropriate.
* Remove unnecessary ok := true
* Addressing comments from code review.
In the internal package, this expands the wire.Load function to run
the same solver as wire.Generate would on any injector function. For
completeness, I also print the injector functions in the gowire show
command.
A subsequent PR will add this as a step to Go Cloud CI.
Updates google/go-cloud#30
This changes both Generate and Load to try to advance as far as possible
while collecting errors. A small helper type, errorCollector, is used to
make control flow easier to read.
Fixesgoogle/go-cloud#5
This represents no functional change, it purely changes the signature
used for functions that can possibly return multiple errors. A
follow-up commit will change the control flow to proceed in the face
of errors.
Updated the call sites to allow multiple errors to be returned from
the package. Load is now permitted to return partial success.
Updates google/go-cloud#5
Idea originally mentioned in google/go-cloud#29. This means that any provider set
loaded must not have cycles, which is stricter than before. The cycle
error message now gives full detail on what caused the cycle.
One small breaking change: a provider set can no longer include an
interface binding to a concrete type that is not being provided
(directly or indirectly) by the provider set. I can't imagine a
reasonable use case for the previous behavior, so this likely will
catch more errors
In terms of operation, binding conflict error messages will now give
much more specific line numbers, since they will be reported closer to
where the problem occurred.
Now that provider sets gather this information, it can be exposed in
the package API. gowire now uses this information instead of
trying to build it itself.
Fixesgoogle/go-cloud#29