I write it on the import tag every time, so it seems a little difficult to operate.
Is it good manners to do goimports-w?
Is it good manners to do goimports-w?
It seems to be that kind of culture.
To be exact, it is customary to use gofmt
after editing the code, and people who want to automate the description of import
use goimports
instead of gofmt
.
For example, vim
's plug-in for Golangvim-go
automatically runs gofmt
when saving files, but the following configuration also introduces the use of goimports
:
Enable goimports to automatically insert import paths installed of gofmt:
letg:go_fmt_command="goimports"
https://github.com/fatih/vim-go
© 2024 OneMinuteCode. All rights reserved.