Skip to content

Commit ece22f5

Browse files
committed
refactor: use function GetGoFilePosition
1 parent b720651 commit ece22f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkg/golinters/gci/gci.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"io"
77
"os"
8-
"strings"
98

109
gcicfg "github.com/daixiang0/gci/pkg/config"
1110
"github.com/daixiang0/gci/pkg/gci"
@@ -81,9 +80,8 @@ func run(lintCtx *linter.Context, pass *analysis.Pass, settings *config.GciSetti
8180
}
8281

8382
for _, file := range pass.Files {
84-
position := goanalysis.GetFilePosition(pass, file)
85-
86-
if !strings.HasSuffix(position.Filename, ".go") {
83+
position, isGoFile := goanalysis.GetGoFilePosition(pass, file)
84+
if !isGoFile {
8785
continue
8886
}
8987

0 commit comments

Comments
 (0)