Example
package main
import(
"bytes"
"errors"
"golang.org/x/tools/go/ast/astutil"
"fmt"
"golang.org/x/tools/imports"
)
...
package main
import (
"bytes"
"errors"
"fmt"
"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/imports"
)
package main
import(
"bytes"
"errors"
"golang.org/x/tools/go/ast/astutil"
"fmt"
"golang.org/x/tools/imports"
)
Features
- grouping/ordering import, if blank line exists before/after paths.
Usage
- set directories or files as arguments of the command.
- if you set the prefix to -local option, the packages which beginning with that prefix put after 3rd-party packages.
GLOBAL OPTIONS:
--local value, -l value specify imports prefix beginning with this string after 3rd-party packages. especially your own organization name. comma-separated list
--write, -w write result source to original file instead od stdout (default: false)
Install
with go
command.
$ go install github.com/tommy-sho/grouper
License
MIT
Author
tommy-sho