package somepkg
type Enum int
const (
EnumValue1 Enum = iota
EnumValue2
EnumValue3
)
package main
import "somepkg"
type nested struct {
Value somepkg.Enum
}
type ext struct {
Foo1 nested
Foo2 nested
Foo3 nested
Foo4 nested
}
func check(){
s := ext{}
switch somepkg.EnumValue2 {
case s.Foo1.Value, s.Foo2.Value, s.Foo3.Value:
}
}
golangci-lint has version v1.41.0 built from (unknown, mod sum: "h1:1kfytWKEn2EPjniwD5xCwWtHAHR57q+vmDX3+VBoJac=") on (unknown)
ERRO [runner] Panic: exhaustive: package "main" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: ast.Expr is *ast.SelectorExpr, not *ast.Ident: goroutine 86804 [running]:
runtime/debug.Stack()
/usr/lib/go/src/runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
/home/boris/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_action.go:101 +0x155
panic({0x124f940, 0xc01b19c0f0})
/usr/lib/go/src/runtime/panic.go:1038 +0x215
github.com/nishanths/exhaustive.missingCasesTextEdit(0x0, 0x1565c10, 0x0, 0xc009ae12c0, 0xc00ad74100, 0xc01b19c000)
/home/boris/go/pkg/mod/github.com/nishanths/[email protected]/switch.go:395 +0x65c
github.com/nishanths/exhaustive.computeFix(0x2, 0xc00fd57c80, 0x203005, 0xc009ae12c0, 0xc016c7f5f0, 0x6, 0xc01b19c000)
/home/boris/go/pkg/mod/github.com/nishanths/[email protected]/switch.go:257 +0xc7
github.com/nishanths/exhaustive.reportSwitch(0xc01df17d40, 0xc009ae12c0, 0x0, 0xc00ad74100, 0x2, 0x131c080, 0x0, 0x0)
/home/boris/go/pkg/mod/github.com/nishanths/[email protected]/switch.go:229 +0xd1
github.com/nishanths/exhaustive.checkSwitchStatements.func1({0x1562668, 0xc009ae12c0}, 0xa, {0xc009e8e300, 0xc0221f1ca0, 0xc01484b810})
/home/boris/go/pkg/mod/github.com/nishanths/[email protected]/switch.go:148 +0x526
golang.org/x/tools/go/ast/inspector.(*Inspector).WithStack(0xc012674b10, {0xc003393b68, 0x1285160, 0xc015f7b390}, 0xc00a443b78)
/home/boris/go/pkg/mod/golang.org/x/[email protected]/go/ast/inspector/inspector.go:126 +0x19a
github.com/nishanths/exhaustive.checkSwitchStatements(0xc01df17d40, 0xf1fdba, 0x1be59a0, 0x14)
/home/boris/go/pkg/mod/github.com/nishanths/[email protected]/switch.go:29 +0x99
github.com/nishanths/exhaustive.run(0xc01df17d40)
/home/boris/go/pkg/mod/github.com/nishanths/[email protected]/exhaustive.go:181 +0x1a5
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc006b309b0)
/home/boris/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_action.go:187 +0x9c4
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
/home/boris/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_action.go:105 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc00187ef50, {0x1381a1e, 0xa}, 0xc00351ff60)
/home/boris/go/pkg/mod/github.com/golangci/[email protected]/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc006b309b0)
/home/boris/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_action.go:104 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0x0)
/home/boris/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0x67
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
/home/boris/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1fd
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: exhaustive: package "main" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: ast.Expr is *ast.SelectorExpr, not *ast.Ident