chore: reformat a little bit

main
sudo pacman -Syu 2023-01-17 11:54:57 +07:00 committed by sudo pacman -Syu
parent b17a39b0dd
commit a9f7cab6f0
1 changed files with 2 additions and 8 deletions

View File

@ -239,10 +239,7 @@ func (ft *Formatter) formatImports(
} }
ft.logDSTImportSpecs("formatImports: dstImportSpecs", dstFile.Imports) ft.logDSTImportSpecs("formatImports: dstImportSpecs", dstFile.Imports)
groupedDSTImportSpecs, err := ft.groupDSTImportSpecs( groupedDSTImportSpecs, err := ft.groupDSTImportSpecs(dstFile.Imports, moduleName)
dstFile.Imports,
moduleName,
)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -263,10 +260,7 @@ func (ft *Formatter) formatImports(
return buf.Bytes(), nil return buf.Bytes(), nil
} }
func (ft *Formatter) groupDSTImportSpecs( func (ft *Formatter) groupDSTImportSpecs(importSpecs []*dst.ImportSpec, moduleName string) (map[string][]*dst.ImportSpec, error) {
importSpecs []*dst.ImportSpec,
moduleName string,
) (map[string][]*dst.ImportSpec, error) {
result := make(map[string][]*dst.ImportSpec) result := make(map[string][]*dst.ImportSpec)
result[stdImport] = make([]*dst.ImportSpec, 0, 8) result[stdImport] = make([]*dst.ImportSpec, 0, 8)
result[thirdPartyImport] = make([]*dst.ImportSpec, 0, 8) result[thirdPartyImport] = make([]*dst.ImportSpec, 0, 8)