Skip to content

Commit 54579a1

Browse files
committed
fix: dupl on Windows
1 parent 225f0f9 commit 54579a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/golinters/dupl/dupl.go

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package dupl
33
import (
44
"fmt"
55
"go/token"
6+
"strings"
67
"sync"
78

89
duplAPI "github.com/golangci/dupl"
@@ -68,6 +69,11 @@ func runDupl(pass *analysis.Pass, settings *config.DuplSettings) ([]goanalysis.I
6869
res := make([]goanalysis.Issue, 0, len(issues))
6970

7071
for _, i := range issues {
72+
// Related to Windows
73+
if !strings.HasSuffix(i.To.Filename(), ".go") {
74+
continue
75+
}
76+
7177
toFilename, err := fsutils.ShortestRelPath(i.To.Filename(), "")
7278
if err != nil {
7379
return nil, fmt.Errorf("failed to get shortest rel path for %q: %w", i.To.Filename(), err)

0 commit comments

Comments
 (0)