1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-06 03:04:06 +02:00
This commit is contained in:
chavacava 2022-09-05 11:11:45 +02:00 committed by GitHub
parent 553604eace
commit 7c2ebbda24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -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:

View File

@ -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{}
}