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

add support for goimports -srcdir in Format #735

Merged
merged 1 commit into from
Feb 24, 2016
Merged

Conversation

mhamrle
Copy link
Contributor

@mhamrle mhamrle commented Feb 22, 2016

"goimports -srcdir" fixes problems with vendoring.

@wuman
Copy link

wuman commented Feb 24, 2016

I can confirm that this PR works well.

@fatih
Copy link
Owner

fatih commented Feb 24, 2016

I was going to add this as this is broken if the user uses an old version of goimports. We need somehow warn the user to update the binary.

"goimports -srcdir" fixes problems with vendoring.
@fatih
Copy link
Owner

fatih commented Feb 24, 2016

I've tested it and it works well. But if you don't update your goimports binary it breaks vim-go. But I think it's ok to move on. This is going to be merged to master and it's not the stale version, so it's ok. Thanks @mhamrle

Also let me put this commit here which introduces this new feature: golang/tools@bf084ef

fatih added a commit that referenced this pull request Feb 24, 2016
add support for goimports -srcdir in Format
@fatih fatih merged commit 199fa8f into fatih:master Feb 24, 2016
@mhamrle
Copy link
Contributor Author

mhamrle commented Feb 24, 2016

I added check if goimports --help contains -srcdir argument. If not the warning message is displayed and the srcdir arg is not used.

@fatih
Copy link
Owner

fatih commented Feb 24, 2016

@mhamrle I've thought about it but I think it would slow down. How did you do the check? Can you open another PR so we can talk about it ?

@fatih
Copy link
Owner

fatih commented Feb 24, 2016

@mhamrle we can speed it up with an intermediate cache value. So we only check once, if it's available we set goimports_updated =1 and don't check it again till the user restarts vim.

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.

3 participants