chore: improve docs
parent
3b35876b7f
commit
8d5c63b8db
|
@ -45,11 +45,9 @@ var bufPool = sync.Pool{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// stdPackages -> save std packages for later search
|
// stdPackages -> save std packages for later search.
|
||||||
//
|
// moduleNames -> map path to its go.mod module name.
|
||||||
// moduleNames -> map path to its go.mod module name
|
// formattedPaths -> make sure we not format path more than 1 time.
|
||||||
//
|
|
||||||
// formattedPaths -> make sure we not format path more than 1 time
|
|
||||||
type Formatter struct {
|
type Formatter struct {
|
||||||
stdPackages map[string]struct{}
|
stdPackages map[string]struct{}
|
||||||
moduleNames map[string]string
|
moduleNames map[string]string
|
||||||
|
@ -234,7 +232,7 @@ func (ft *Formatter) formatFile(path string) error {
|
||||||
// First parse ast.
|
// First parse ast.
|
||||||
// Then group imports.
|
// Then group imports.
|
||||||
// Then format imports.
|
// Then format imports.
|
||||||
// Then print.
|
// Then print to bytes.
|
||||||
func (ft *Formatter) formatImports(
|
func (ft *Formatter) formatImports(
|
||||||
path string,
|
path string,
|
||||||
pathBytes []byte,
|
pathBytes []byte,
|
||||||
|
|
Loading…
Reference in New Issue