Skip to content
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

Set explicit import alias for zanzibar runtime package in templates #734

Merged
merged 3 commits into from Jul 29, 2020

Conversation

ChuntaoLu
Copy link
Contributor

@ChuntaoLu ChuntaoLu commented Jul 29, 2020

When generated code is formatted by goimports, import github.com/uber/zanzibar/runtime is removed if the library is not in GOPATH, because goimports can't resolve the alias zanzibar to github/uber/zanzibar/runtime. This PR fixes such problem by setting explicit import alias for github/uber/zanzibar/runtime in templates.

@ChuntaoLu ChuntaoLu requested a review from rpatali July 29, 2020 03:09
@rpatali
Copy link
Contributor

rpatali commented Jul 29, 2020

files inside build dir didn't change?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 69.447% when pulling d54fdba on lu.import into cfa3fad on master.

@ChuntaoLu
Copy link
Contributor Author

files inside build dir didn't change?

Yes, no changes are expected. When zanzibar is in GOPATH, everything is fine. Only when zanzibar is absent in GOPATH, goimports will incorrectly remove github.com/uber/zanzibar/runtime if zanzibar alias is not explicitly set, with wrong assumption that github.com/uber/zanzibar/runtime is not used.

Copy link
Contributor

@rpatali rpatali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChuntaoLu ChuntaoLu merged commit 05b204c into master Jul 29, 2020
@ChuntaoLu ChuntaoLu deleted the lu.import branch July 29, 2020 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants