-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/cmd/goimports: add -s flag #8759
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
Comments
I am not against it but gofmt (or go fmt) is not depending on anything but the std lib at the moment. Note that we are also considering removing that -r option from gofmt; so it may make sense to remove the -s option as well and have a separate tool instead. Not for 1.4 for sure. Status changed to Thinking. |
Let’s see if we can keep this up for long. golang/go#8759 tracks adding -s to goimports, so that we could use it in our editor configs.
This is causing some issues on my end - is this ever going to be considered? Or, at the least, the documentation needs to be updated. |
I forked the tools repository and added this behavior if anyone is interested: I just copied the code from gofmt and removed the import comments: https://github.com/jzelinskie/tools/commit/348c54dbd0dc54b93cd91d71cfd483d55d00f971 If you're using vim-go you can add the following to your .vimrc to get both
|
Related: #14500 |
(Note FTR: per golang/tools@7d47e84, goimports is no longer claimed to be "a drop-in replacement [for gofmt]".) |
@akavel, thanks. I'll close this then. |
The text was updated successfully, but these errors were encountered: