Repository: google/wire (go)

Issue:
Better message for unused provider
Hello.
This is my first PR, if there is something wrong, please, let me know.

My code usually looks like this
```go 
wire.Build(
	New,
	router.New,
	runtime.New,
)
```

When, for example, runtime becomes unused, wire returns this message 
`wire.go:1:1: inject Init: unused provider "New`

Is very hard to find which dependency is unused.

There is my suggested solution.  https://github.com/google/wire/pull/162

Pull request description:
wire: This fixes message for unused provider
`Fixes #161 `.


Patch:
diff --git a/internal/wire/analyze.go b/internal/wire/analyze.go
index 99ee919..e6c3d67 100644
--- a/internal/wire/analyze.go
+++ b/internal/wire/analyze.go
@@ -276,7 +276,7 @@ func verifyArgsUsed(set *ProviderSet, used []*providerSetSrc) []error {
 			}
 		}
 		if !found {
-			errs = append(errs, fmt.Errorf("unused provider %q", p.Name))
+			errs = append(errs, fmt.Errorf("unused provider %q", p.Pkg.Name() + "." + p.Name))
 		}
 	}
 	for _, v := range set.Values {


Test patch:
diff --git a/internal/wire/testdata/UnusedProviders/want/wire_errs.txt b/internal/wire/testdata/UnusedProviders/want/wire_errs.txt
index ca323ab..a34cab2 100644
--- a/internal/wire/testdata/UnusedProviders/want/wire_errs.txt
+++ b/internal/wire/testdata/UnusedProviders/want/wire_errs.txt
@@ -1,6 +1,6 @@
 example.com/foo/wire.go:x:y: inject injectBar: unused provider set "unusedSet"
 
-example.com/foo/wire.go:x:y: inject injectBar: unused provider "provideUnused"
+example.com/foo/wire.go:x:y: inject injectBar: unused provider "main.provideUnused"
 
 example.com/foo/wire.go:x:y: inject injectBar: unused value of type string