You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Received unexpected error:
final-func: user-chain(2) [func(context.Context, public.Resolver)]: required but no provider for public.Resolver in inputs (not provided by injector: integration-before-user(5) [func(*pkg.Client) public.Resolver] because has no match for its input parameter *pkg.Client)
There was in fact a pkg.Client available, but the injector listed above was expecting a pkg/v2.Client, not a pkg.Client.
This was confusing to debug. It would be nice if types included a version indicator for non-v1 pakages. Or is this a more general problem with resolving package aliases in general?
The text was updated successfully, but these errors were encountered:
Unfortunately, the Go reflect package doesn't help much here.
For a direct type, I can solve it. For a pointer, slice, etc, I'm not sure how.
Here's the relevant bit of documentation from the reflect package:
// PkgPath returns a defined type's package path, that is, the import path// that uniquely identifies the package, such as "encoding/base64".// If the type was predeclared (string, error) or not defined (*T, struct{},// []int, or A where A is an alias for a non-defined type), the package path// will be the empty string.PkgPath() string
So, I could change pkg.Client to pkg/v2.Client, but I cannot change *pkg.Client :(
In the case of a failure, I can, perhaps walk through all seen types and see if there are any that have the same name and include that in the failure message. That might provide a hint of that there is a problem, but it could be overlooked.
Injection failed with this message:
There was in fact a
pkg.Client
available, but the injector listed above was expecting apkg/v2.Client
, not apkg.Client
.This was confusing to debug. It would be nice if types included a version indicator for non-v1 pakages. Or is this a more general problem with resolving package aliases in general?
The text was updated successfully, but these errors were encountered: