Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Style: Enforce maximum of 2 import groups for go files
There isn't a whole lot of direction from the go project or tools for this. A quick google search did turn up 2 projects that also document 2 groups, both [Uber] and [CockroachDB]. We do have both goimports and gofumpt splitting stdlib vs others out if they are mixed. But they don't do any futher kind of grouping. So in the absence of concrete handling lets just settle on 2 because its easy to enforce. The script below deletes newlines within `import ( ... )` blocks and then runs gofumpt which will split and sort 2 at most 2 groups. [Uber]: https://github.com/uber-go/guide/blob/22f61e283ac2f75ba34b62f565581cc70e35fb7a/style.md#import-group-ordering [CockroachDB]: https://web.archive.org/web/20210509102622/https://wiki.crdb.io/wiki/spaces/CRDB/pages/181371303/Go+Golang+coding+guidelines#Import-Group-Ordering Signed-off-by: Manuel Mendez <[email protected]>
- Loading branch information