Commit 958a9339 authored by Mehdy Bohlool's avatar Mehdy Bohlool

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

The wrong type assignment resulted in wrong imports
parent 8f92b8e2
...@@ -116,7 +116,10 @@ func assignGoTypeToProtoPackage(p *protobufPackage, t *types.Type, local, global ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment