You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is no convention on how to group the imports. Different developers may format imports to different groups. This usually results in unnecessary code changes when submitting a PR. Although we use goimports to format the imports, goimports doesn't work correctly in many scenarios, see discussion in golang/go#20818.
gci is a tool that control golang package import order and make it always deterministic. It can always sort imports into exactly two groups or three groups. And gci is also a built-in linter in golangci-lint. So I think we can add gci to our lint scripts. 2 imports groups or 3 import groups is still not yet determined.
There are some known compatibility issues for gci with other linters, see golangci/golangci-lint#1490. But most issues are very rare to encounter.
The text was updated successfully, but these errors were encountered:
Currently, there is no convention on how to group the imports. Different developers may format imports to different groups. This usually results in unnecessary code changes when submitting a PR. Although we use goimports to format the imports,
goimports
doesn't work correctly in many scenarios, see discussion in golang/go#20818.gci is a tool that control golang package import order and make it always deterministic. It can always sort imports into exactly two groups or three groups. And gci is also a built-in linter in golangci-lint. So I think we can add gci to our lint scripts. 2 imports groups or 3 import groups is still not yet determined.
There are some known compatibility issues for gci with other linters, see golangci/golangci-lint#1490. But most issues are very rare to encounter.
The text was updated successfully, but these errors were encountered: