feat: ignore empty import
parent
57e4bbd4d7
commit
7bb5fc7d63
|
@ -219,10 +219,16 @@ func (ft *Formatter) formatImports(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ignore second import decl and more
|
||||||
if isExistFirstImportDecl {
|
if isExistFirstImportDecl {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ignore empty import
|
||||||
|
if len(genDecl.Specs) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// First import decl take all
|
// First import decl take all
|
||||||
isExistFirstImportDecl = true
|
isExistFirstImportDecl = true
|
||||||
genDecl.Specs = formattedImportSpecs
|
genDecl.Specs = formattedImportSpecs
|
||||||
|
|
Loading…
Reference in New Issue