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