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 goimports support to go layer #3065

Closed
vise890 opened this issue Sep 17, 2015 · 4 comments
Closed

Add goimports support to go layer #3065

vise890 opened this issue Sep 17, 2015 · 4 comments

Comments

@vise890
Copy link
Contributor

vise890 commented Sep 17, 2015

Goimports adds required imports and removes unneeded ones on file save (and gofmts the buffer). It is a drop-in replacement fro gofmt with this extra functionality. I find it extremely convenient.

Any thoughts on adding it to the go layer?

The go layer already has a bunch of dependencies on external tools, so adding another one shouldn't be much of a hassle?

@vise890 vise890 changed the title Add goimports to go layer Add goimports support to go layer Sep 17, 2015
@ntcong
Copy link
Contributor

ntcong commented Sep 23, 2015

It can be easily added with (setq gofmt-command "goimports"). Personally I think gofmt is good enough for a baseline configuration, there's no need to add goimports.

Adding a guide in go layer's documentation is more than enough.

TheBB added a commit to TheBB/spacemacs that referenced this issue Sep 30, 2015
@TheBB TheBB mentioned this issue Sep 30, 2015
TheBB added a commit to TheBB/spacemacs that referenced this issue Sep 30, 2015
TheBB added a commit that referenced this issue Oct 5, 2015
@codygman
Copy link

@ntcong Perhaps the best option would be to let the user have a configuration option, then apply your (setq gofmt-command "goimports") recommendation if the user wants to use goimports.

Personally I think gofmt is good enough for a baseline configuration, there's no need to add goimports.

Is spacemacs about providing a baseline configuration to customize, or something featureful out of the box? My impression is that Spacemacs is more about the latter while trying it's best not to sacrifice speed or customization ability.

@ntcong
Copy link
Contributor

ntcong commented Nov 20, 2015

in order to know the configuration variable, the user will have to read the README, it is just 1 line of command, so configuration variable or a documented user-config is no different.

Adding a new configuration pollutes the layer, and doesn't offer anything better, so I'm against this.

@codygman
Copy link

This is my opinion:

From a user perspective a user config is much less opaque. The one line command requires more indepth knowledge of spacemacs/emacs whereas the configuration option will let any user think "yes, I want to add goimports support" and follow typical spacemacs layer configuration style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants