Skip to content

Commit f8c79ef

Browse files
committed
simplify goimports
1 parent f74a669 commit f8c79ef

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

internal/imports/sortimports.go

+1-12
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,7 @@ func sortImports(localPrefix string, fset *token.FileSet, f *ast.File) {
3434
continue
3535
}
3636

37-
// Identify and sort runs of specs on successive lines.
38-
i := 0
39-
specs := d.Specs[:0]
40-
for j, s := range d.Specs {
41-
if j > i && fset.Position(s.Pos()).Line > 1+fset.Position(d.Specs[j-1].End()).Line {
42-
// j begins a new run. End this one.
43-
specs = append(specs, sortSpecs(localPrefix, fset, f, d.Specs[i:j])...)
44-
i = j
45-
}
46-
}
47-
specs = append(specs, sortSpecs(localPrefix, fset, f, d.Specs[i:])...)
48-
d.Specs = specs
37+
d.Specs = sortSpecs(localPrefix, fset, f, d.Specs)
4938

5039
// Deduping can leave a blank line before the rparen; clean that up.
5140
if len(d.Specs) > 0 {

0 commit comments

Comments
 (0)