Fix Proto Generator to not assign types to packages they don't belong to

The wrong type assignment resulted in wrong imports
This commit is contained in:
Mehdy Bohlool 2018-08-08 12:47:56 -07:00
parent 8f92b8e288
commit 958a9339a3

View File

@ -116,7 +116,10 @@ func assignGoTypeToProtoPackage(p *protobufPackage, t *types.Type, local, global
} }
return return
} }
global[t.Name] = p if t.Name.Package == p.PackagePath {
// Associate types only to their own package
global[t.Name] = p
}
if _, ok := local[t.Name]; ok { if _, ok := local[t.Name]; ok {
return return
} }