modulepackage
0.1.0
Repository: https://github.com/project-centurion/ordino.git
Documentation: pkg.go.dev
# README
Ordino
This package sorts Go imports in groups and in a default or user-defined order.
Shoulders
This customized package uses a lot of the logic and some tools from goimports-reviser
Requirements
- Go 1.17;
- [GolangCI-Lint CMD][https://github.com/golangci/golangci-lint];
- [Staticcheck CMD][https://staticcheck.io];
Usage
Install it by running:
go install github.com/Project-Centurion/ordino@latest
ordino -project-name [YourProjectName] -output [TheOutPutYouWant] -order [thePackagesOrderYouWant] [file/path/to/your/gofile.go]
Required arguments
- single file sorting
file/path/to/your/gofile.go
: the path from the current directory to the file where you want your imports sorted.
- recursive run
./...
: sorts imports from all the.go
files under the current directory
example :
ordino -project-name [YourProjectName] ./...
Optional arguments
theOutPutYouWant
: eitherfile
orstdout
, by defaultfile
(will rewrite the files sorted).thePackagesOrderYouWant
: constructed like thisstd,alias,project,general
by default, meaning the order you want between the packages, separated by commas, no spaces. Aliased packages being separated are optional.YourProjectName
: the imports you want sorted asproject
imports. Please provide the path to those imports such asgithub.com/MyGreatProject
orgithub.com/MyGreatProject/mySuperGreatGoRepository
. If not set, the project name will be fetched fromgo.mod
Real life examples:
ordino -order std,project,general -project-name github.com/Project-Centurion/ordino ./...
ordino -order project,general,std -output stdout main.go
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author