Skip to content

Commit

Permalink
Remove extra space
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
  • Loading branch information
daixiang0 committed Aug 7, 2020
1 parent 1a47373 commit c177722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/gci/gci.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ func getPkgInfo(line string, comment bool) (string, string, string) {
s := strings.Split(line, commentFlag)
pkgArray := strings.Split(s[0], blank)
if len(pkgArray) > 1 {
return pkgArray[1], pkgArray[0], fmt.Sprintf("%s%s%s", commentFlag, blank, s[1])
return pkgArray[1], pkgArray[0], fmt.Sprintf("%s%s%s", commentFlag, blank, strings.TrimSpace(s[1]))
} else {
return pkgArray[0], "", fmt.Sprintf("%s%s%s", commentFlag, blank, s[1])
return strings.TrimSpace(pkgArray[0]), "", fmt.Sprintf("%s%s%s", commentFlag, blank, strings.TrimSpace(s[1]))
}
} else {
pkgArray := strings.Split(line, blank)
Expand Down

0 comments on commit c177722

Please sign in to comment.