github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/testdata/nested-structs.go (about) 1 package fixtures 2 3 type Foo struct { 4 Bar struct { // MATCH /no nested structs are allowed/ 5 Baz struct { // MATCH /no nested structs are allowed/ 6 b bool 7 Qux struct { // MATCH /no nested structs are allowed/ 8 b bool 9 } 10 } 11 } 12 } 13 14 type Quux struct { 15 Quuz Quuz 16 } 17 18 type Quuz struct { 19 } 20 21 func waldo() (s struct{ b bool }) { return s } 22 23 func fred() interface{} { 24 s := struct { 25 b bool 26 t struct { // MATCH /no nested structs are allowed/ 27 b bool 28 } 29 }{} 30 31 return s 32 }