obfuscate alias names like any other objects
Before this change, we would try to never obfuscate alias names. That was far from ideal, as they can end up in field names via anonymous fields. Even then, we would sometimes still fail to build, because we would inconsistently obfuscate alias names. For example, in the added test case: --- FAIL: TestScripts/syntax (0.23s) testscript.go:397: > env GOPRIVATE='test/main,private.source' > garble build [stderr] # test/main/sub Lv_a8gRD.go:15: undefined: KCvSpxmQ To fix this problem, we set obj to be the TypeName corresponding to the alias when it is used as an embedded field. We can then make the right choice when obfuscating the name. Right now, all aliases will be obfuscated. A TODO exists about not obfuscating alias names when they're used as embedded fields in a struct type in the same package, and that package is used for reflection - since then, the alias name ends up as the field name. With these changes, the protobuf module now builds.pull/340/head
parent
68f07389b2
commit
65ff07875b
Loading…
Reference in New Issue