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
Is your feature request related to a problem? Please describe.
It's a go convention not to start a variable name in a package with the package name, which means that config should export config.Provider not config.ConfigProvider. However, wire doesn't include the package name in error messages which forces us to name providers package.PackageProvider for error visibility.
When combined with other generation tools (e.g. proto3), sometimes interfaces are renamed or moved during code generation. The wire error message just refers to the missing interface as invalid type, which is not very useful for debugging.
Describe the solution you'd like
Error messages referring to a provider should contain the full variable path including the package name (e.g. config.Provider instead of just Provider)
Error messages referring to an invalid type should include the raw text name of that type.
Example:
init(sServiceA){
...
}
Current error:
inject init: no provider found for invalid type
Improved error:
inject init: no provider found for invalid type (ServiceA)
Describe alternatives you've considered
For the first problem, the alternative is to include package names in the provider var name as per the example. For the second problem, there are no alternatives to wire printing the interface name.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
It's a go convention not to start a variable name in a package with the package name, which means that
config
should exportconfig.Provider
notconfig.ConfigProvider
. However, wire doesn't include the package name in error messages which forces us to name providerspackage.PackageProvider
for error visibility.When combined with other generation tools (e.g. proto3), sometimes interfaces are renamed or moved during code generation. The wire error message just refers to the missing interface as
invalid type
, which is not very useful for debugging.Describe the solution you'd like
Error messages referring to a provider should contain the full variable path including the package name (e.g.
config.Provider
instead of justProvider
)Error messages referring to an invalid type should include the raw text name of that type.
Example:
Current error:
Improved error:
Describe alternatives you've considered
For the first problem, the alternative is to include package names in the provider var name as per the example. For the second problem, there are no alternatives to wire printing the interface name.
The text was updated successfully, but these errors were encountered: