3 ms·
Just for what it's worth, `goimports` has done this for many years: https://pkg.go.dev/golang.org/x/tools/cmd/goimports https://pkg.go.dev/golang.org/x/tools/c
by tptacek 5y ago
Just for what it's worth, `goimports` has done this for many years:
https://pkg.go.dev/golang.org/x/tools/cmd/goimports https://pkg.go.dev/golang.org/x/tools/cmd/goimports
It's how Emacs handled inputs before there was lsp-mode, and presumably is easy to link into other editors too (it's just an implementation of gofmt that manages imports). I agree: it's an extremely nice feature to have.
- na85 5y agoAh, well, I only picked up go very recently so I have no experience writing go outside of the emacs+lsp environment.
- tptacek 5y agoDon't let me sound like I'm talking down lsp-mode, even though I have never gotten it to work reliably (railwaycat, Go, and Rust, and lots of TRAMP). lsp-mode is neat.
- na85 5y agoI use the railwaycat fork also, and it works fine for me writing go. I don't enjoy rust so I've never tried. If you're interested, my emacs config is here: https://github.com/nathanvy/dotemacs/blob/master/init.org https://github.com/nathanvy/dotemacs/blob/master/init.org