mirror of
https://github.com/mgechev/revive.git
synced 2025-01-06 03:04:06 +02:00
parent
54ee9dbcde
commit
a4f4632a3f
@ -37,6 +37,11 @@ type lintNestedStructs struct {
|
||||
|
||||
func (l *lintNestedStructs) Visit(n ast.Node) ast.Visitor {
|
||||
switch v := n.(type) {
|
||||
case *ast.TypeSpec:
|
||||
_, isInterface := v.Type.(*ast.InterfaceType)
|
||||
if isInterface {
|
||||
return nil // do not analyze interface declarations
|
||||
}
|
||||
case *ast.FuncDecl:
|
||||
if v.Body != nil {
|
||||
ast.Walk(l, v.Body)
|
||||
|
5
testdata/nested-structs.go
vendored
5
testdata/nested-structs.go
vendored
@ -40,3 +40,8 @@ type Bad struct {
|
||||
type issue744 struct {
|
||||
c chan struct{}
|
||||
}
|
||||
|
||||
// issue 781
|
||||
type mySetInterface interface {
|
||||
GetSet() map[string]struct{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user