3 ms·
So I've given Go a try with a couple of projects, and I like it so far. However, I really don't like its "warnings are errors" feature — in particular in respec
by socksy 13y ago
So I've given Go a try with a couple of projects, and I like it so far. However, I really don't like its "warnings are errors" feature — in particular in respect to unused imports. If I comment out a line that uses an import, then it no longer compiles until I go to the top of the file and comment it out.
Has anyone come up with a good solution to this? Preferably using Vim tooling.
- dchest 13y agoYep. In vim (make sure to have plugins that come with go in misc/vim/ directory installed): :Drop fmt to remove package "fmt" from imports, and :Import fmt to put it back.
- farslan 13y agoJust use goimports which is removing/adding imports automatically based on your source code: https://github.com/bradfitz/goimports https://github.com/bradfitz/goimports