1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-30 08:57:07 +02:00
revive/testdata/nested-structs.go
Robert Deusser 575ce5f61a
new rule: nested-structs (#530)
new rule: nested-structs
2021-06-15 11:36:41 +02:00

33 lines
481 B
Go

package fixtures
type Foo struct {
Bar struct { // MATCH /no nested structs are allowed/
Baz struct { // MATCH /no nested structs are allowed/
b bool
Qux struct { // MATCH /no nested structs are allowed/
b bool
}
}
}
}
type Quux struct {
Quuz Quuz
}
type Quuz struct {
}
func waldo() (s struct{ b bool }) { return s }
func fred() interface{} {
s := struct {
b bool
t struct { // MATCH /no nested structs are allowed/
b bool
}
}{}
return s
}