mirror of
https://github.com/mgechev/revive.git
synced 2025-01-06 03:04:06 +02:00
parent
553604eace
commit
7c2ebbda24
@ -43,6 +43,11 @@ func (l *lintNestedStructs) Visit(n ast.Node) ast.Visitor {
|
||||
}
|
||||
return nil
|
||||
case *ast.Field:
|
||||
_, isChannelField := v.Type.(*ast.ChanType)
|
||||
if isChannelField {
|
||||
return nil
|
||||
}
|
||||
|
||||
filter := func(n ast.Node) bool {
|
||||
switch n.(type) {
|
||||
case *ast.StructType:
|
||||
|
5
testdata/nested-structs.go
vendored
5
testdata/nested-structs.go
vendored
@ -35,3 +35,8 @@ func fred() interface{} {
|
||||
type Bad struct {
|
||||
Field []struct{} // MATCH /no nested structs are allowed/
|
||||
}
|
||||
|
||||
// issue744
|
||||
type issue744 struct {
|
||||
c chan struct{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user