-
Notifications
You must be signed in to change notification settings - Fork 4.1k
THRIFT-4797: Golang: Fix import collisions #1811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
THRIFT-4797: Golang: Fix import collisions #1811
Conversation
b19d8f1 to
2f87ca9
Compare
|
Just found another case to handle here. I should also detect collisions with the golang packages that get imported like |
|
For stdlib collisions like |
|
@dcelasun I made it use a vector for system imports can you take a look? I’ll squash it together if/when it looks good to you! |
|
Looks good! |
a2bd8b0 to
47685dc
Compare
|
@dcelasun squashed and ready to merge! |
|
Actually hold on merging for a bit. I may have found another edge case |
|
Yep, confirmed. If the package has a service, and that package’s last namespace component conflicts with a previously imported package, it won’t get aliased. Hopefully I can get a chance to fix tomorrow |
|
@dcelasun one more commit to review to fix the issue with the remote package import collisions! Hopefully this is it |
e940bfa to
fddab5d
Compare
|
LGTM. Tried testing a few different scenarios locally, everything works fine. Thanks for the PR! |
See THRIFT-4797 for details. In short, Golang compilation fails when a Thrift file includes two files that have the same final namespace component (e.g.
namespace go packagea.commonandnamespace go packageb.common)Somewhat based on fbthrift's implementation though their implementation simply always adds an alias with a unique numerical prefix.