Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/slintes/sort-imports

Small tool for sorting and grouping go imports
https://github.com/slintes/sort-imports

Last synced: 20 days ago
JSON representation

Small tool for sorting and grouping go imports

Awesome Lists containing this project

README

        

# sort-imports

Sort Go imports according to our best practices, separated by an empty line:

- Internal packages
- All other packages
- Openshift packages
- Kubernetes packages
- Packages of own module

## Usage

```
go install github.com/slintes/sort-imports
sort-imports [-w]
```

- the `-w` option will overwrite source files with fixed imports (use on your own risk,
use source control!)
- the return code will indicate status:
- `0`: all imports are fine or were overwritten
- `1`: an error occured
- `2`: there are unfixed unsorted or ungrouped imports, check output for details