Skip to content

Commit 03acdea

Browse files
authored
fix extra linkbreak in the end (#73)
Signed-off-by: Loong Dai <[email protected]>
1 parent a0b03a1 commit 03acdea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/gci/gci.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ func LoadFormatGoFile(file io.FileObj, cfg config.Config) (src, dist []byte, err
180180
AddIndent(&body, &firstWithIndex)
181181
body = append(body, src[d.Start:d.End]...)
182182
}
183-
body = append(body, utils.Linebreak)
183+
if body[len(body)-1] != utils.Linebreak {
184+
body = append(body, utils.Linebreak)
185+
}
184186
}
185187

186188
// remove breakline in the end

0 commit comments

Comments
 (0)