-
Notifications
You must be signed in to change notification settings - Fork 6
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
[go] goimport that check and replace specific import #118
Comments
I should be part of #75 |
Found one linter from m3db https://github.com/m3db/build-tools/tree/master/linters/importorder |
Also there is one checking if specific import is allowed https://github.com/fatih/faillint |
Source of goimports https://github.com/golang/tools/blob/master/cmd/goimports/goimports.go |
https://pkg.go.dev/golang.org/x/tools/go/ast/astutil?tab=doc#AddImport astutil contains add and remove imports, looks pretty good ... not sure if we can do something similar to goimports using that |
https://github.com/cockroachdb/crlfmt/blob/master/main.go#L238 found one from cockroachdb, crlfmt |
https://github.com/OpenPeeDeeP/depguard found from golint ci |
Now I use goimport instead of gofmt when formatting code because it checks import and do the sorting. However I have some new use cases:
xxxpb
Should put it under
gommon fmt
orgommon gofmt
The text was updated successfully, but these errors were encountered: