wire: fill in ProviderSet.VarName when the set is a package variable (google/go-cloud#279)

Rename ProviderSet.Name to ProviderSet.VarName.

Fixes google/go-cloud#277
This commit is contained in:
Robert van Gent
2018-08-02 14:00:17 -07:00
committed by Ross Light
parent 85deb53791
commit 3a3760180d
5 changed files with 17 additions and 16 deletions

View File

@@ -217,8 +217,8 @@ func gather(info *wire.Info, key wire.ProviderSetID) (_ []outGroup, imports map[
continue
}
visited[curr] = struct{}{}
if curr.Name != "" && !(curr.PkgPath == key.ImportPath && curr.Name == key.VarName) {
imports[formatProviderSetName(curr.PkgPath, curr.Name)] = struct{}{}
if curr.VarName != "" && !(curr.PkgPath == key.ImportPath && curr.VarName == key.VarName) {
imports[formatProviderSetName(curr.PkgPath, curr.VarName)] = struct{}{}
}
for _, imp := range curr.Imports {
next = append(next, imp)