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

Removes imports on :w. #43

Closed
zackp30 opened this issue Apr 4, 2014 · 5 comments
Closed

Removes imports on :w. #43

zackp30 opened this issue Apr 4, 2014 · 5 comments

Comments

@zackp30
Copy link

zackp30 commented Apr 4, 2014

On :w it removes all lines enclosed in import. It was working fine before, but now it doesn't.
(Thanks for making this plugin, by the way, it's very useful. :))

@fatih
Copy link
Owner

fatih commented Apr 4, 2014

It works perfectly for me. Nothing has changed on formatting too. Can you give me an example snippet or code for me to test it?

@zackp30
Copy link
Author

zackp30 commented Apr 4, 2014

package main

import (
   "fmt"
)

func main() {}

Hmm, just realized it only seems to happen with an empty main() block, perhaps a gofmt bug?
EDIT: And thanks for the quick response. :)
EDIT 2: Not that it matters if it's an empty func main() {}, but just thought it was a weird quirk.

@zackp30 zackp30 closed this as completed Apr 4, 2014
@zackp30
Copy link
Author

zackp30 commented Apr 4, 2014

Ahh, I see now, gofmt also removes unused imports. facepalm Anyway, thanks, and have a nice day. :)

@fatih
Copy link
Owner

fatih commented Apr 4, 2014

@zackp30 goimports is removing unused impots :) But you can change it to gofmt with:

let g:go_fmt_command = "gofmt"

This will only format but will not add or remove imports automatically

@zackp30
Copy link
Author

zackp30 commented Apr 4, 2014

Alright, thanks. :)

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

No branches or pull requests

2 participants