Skip to content

Commit

Permalink
fix extra linkbreak in the end (#73)
Browse files Browse the repository at this point in the history
Signed-off-by: Loong Dai <loong.dai@intel.com>
  • Loading branch information
daixiang0 committed Jul 13, 2022
1 parent a0b03a1 commit 03acdea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/gci/gci.go
Expand Up @@ -180,7 +180,9 @@ func LoadFormatGoFile(file io.FileObj, cfg config.Config) (src, dist []byte, err
AddIndent(&body, &firstWithIndex)
body = append(body, src[d.Start:d.End]...)
}
body = append(body, utils.Linebreak)
if body[len(body)-1] != utils.Linebreak {
body = append(body, utils.Linebreak)
}
}

// remove breakline in the end
Expand Down

0 comments on commit 03acdea

Please sign in to comment.