Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/slintes/sort-imports
- Owner: slintes
- License: apache-2.0
- Created: 2022-09-17T16:08:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-08T20:20:27.000Z (6 months ago)
- Last Synced: 2024-11-14T06:11:14.382Z (2 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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