Skip to content

Commit 1bee3f6

Browse files
committed
feat: use upstream gocyclo.
1 parent 1b30a17 commit 1bee3f6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ require (
1515
github.com/denis-tingajkin/go-header v0.4.2
1616
github.com/esimonov/ifshort v1.0.1
1717
github.com/fatih/color v1.10.0
18+
github.com/fzipp/gocyclo v0.3.1
1819
github.com/go-critic/go-critic v0.5.4
1920
github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b
2021
github.com/gofrs/flock v0.8.0
2122
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
2223
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a
2324
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6
2425
github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613
25-
github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d
2626
github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a
2727
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc
2828
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/gocyclo.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"sort"
77
"sync"
88

9-
gocycloAPI "github.com/golangci/gocyclo/pkg/gocyclo"
9+
"github.com/fzipp/gocyclo"
1010
"golang.org/x/tools/go/analysis"
1111

1212
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
@@ -31,9 +31,9 @@ func NewGocyclo() *goanalysis.Linter {
3131
nil,
3232
).WithContextSetter(func(lintCtx *linter.Context) {
3333
analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
34-
var stats []gocycloAPI.Stat
34+
var stats []gocyclo.Stat
3535
for _, f := range pass.Files {
36-
stats = gocycloAPI.BuildStats(f, pass.Fset, stats)
36+
stats = gocyclo.AnalyzeASTFile(f, pass.Fset, stats)
3737
}
3838
if len(stats) == 0 {
3939
return nil, nil

0 commit comments

Comments
 (0)