Skip to content

Commit 6752f12

Browse files
committed
fix: dupl on Windows
1 parent 225f0f9 commit 6752f12

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/golinters/dupl/dupl.go

+11
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"
@@ -56,6 +57,16 @@ func New(settings *config.DuplSettings) *goanalysis.Linter {
5657
func runDupl(pass *analysis.Pass, settings *config.DuplSettings) ([]goanalysis.Issue, error) {
5758
fileNames := internal.GetFileNames(pass)
5859

60+
var onlyGofiles []string
61+
for _, name := range fileNames {
62+
// Related to Windows
63+
if !strings.HasSuffix(name, ".go") {
64+
continue
65+
}
66+
67+
onlyGofiles = append(onlyGofiles, name)
68+
}
69+
5970
issues, err := duplAPI.Run(fileNames, settings.Threshold)
6071
if err != nil {
6172
return nil, err

0 commit comments

Comments
 (0)