Skip to content

Commit

Permalink
fix bug and bump up to 1.19.2
Browse files Browse the repository at this point in the history
Signed-off-by: Loong <[email protected]>
  • Loading branch information
daixiang0 committed Oct 21, 2022
1 parent 1cb9f5f commit 80882bf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/daixiang0/gci/cmd/gci"
)

var version = "0.8.0"
var version = "0.8.1"

func main() {
e := gci.NewExecutor(version)
Expand Down
2 changes: 1 addition & 1 deletion pkg/gci/gci.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func LoadFormatGoFile(file io.FileObj, cfg config.Config) (src, dist []byte, err
}

var head []byte
if src[headEnd-1] == '\t' {
if src[headEnd-1] == '\t' || src[headEnd-1] == utils.Linebreak {
head = src[:headEnd]
} else {
// handle multiple import blocks
Expand Down
1 change: 1 addition & 0 deletions pkg/gci/internal/testdata/no-format.cfg.yaml
9 changes: 9 additions & 0 deletions pkg/gci/internal/testdata/no-format.in.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"fmt"

g "github.com/golang"

"github.com/daixiang0/gci"
)
9 changes: 9 additions & 0 deletions pkg/gci/internal/testdata/no-format.out.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"fmt"

g "github.com/golang"

"github.com/daixiang0/gci"
)
2 changes: 1 addition & 1 deletion pkg/section/standard_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 80882bf

Please sign in to comment.