Skip to content

Commit

Permalink
fix: dupl on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Dec 16, 2024
1 parent 225f0f9 commit 6752f12
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/golinters/dupl/dupl.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dupl
import (
"fmt"
"go/token"
"strings"
"sync"

duplAPI "github.com/golangci/dupl"
Expand Down Expand Up @@ -56,6 +57,16 @@ func New(settings *config.DuplSettings) *goanalysis.Linter {
func runDupl(pass *analysis.Pass, settings *config.DuplSettings) ([]goanalysis.Issue, error) {
fileNames := internal.GetFileNames(pass)

var onlyGofiles []string
for _, name := range fileNames {
// Related to Windows
if !strings.HasSuffix(name, ".go") {
continue
}

onlyGofiles = append(onlyGofiles, name)

Check failure on line 67 in pkg/golinters/dupl/dupl.go

View workflow job for this annotation

GitHub Actions / golangci-lint

SA4010: this result of append is never used, except maybe in other appends (staticcheck)
}

issues, err := duplAPI.Run(fileNames, settings.Threshold)
if err != nil {
return nil, err
Expand Down

0 comments on commit 6752f12

Please sign in to comment.