2018-06-08 21:41:49 +02:00
|
|
|
// Test of empty-blocks.
|
|
|
|
|
|
|
|
package fixtures
|
|
|
|
|
2018-06-11 21:08:59 +02:00
|
|
|
func f(x int) bool {} // Must not match
|
2018-06-08 21:41:49 +02:00
|
|
|
|
2018-06-11 21:08:59 +02:00
|
|
|
type foo struct {}
|
|
|
|
|
|
|
|
func (f foo) f(x *int) string {} // Must not match
|
|
|
|
func (f *foo) g(y *int) string {} // Must not match
|
2018-06-08 21:41:49 +02:00
|
|
|
|
|
|
|
func g(f func() bool) string {
|
|
|
|
{ // MATCH /this block is empty, you can remove it/
|
|
|
|
}
|
|
|
|
|
2018-06-11 21:08:59 +02:00
|
|
|
a := func(e error){} // Must not match
|
|
|
|
|
2018-06-08 21:41:49 +02:00
|
|
|
if ok := f(); ok { // MATCH /this block is empty, you can remove it/
|
|
|
|
// only a comment
|
|
|
|
} else {
|
|
|
|
println("it's NOT empty!")
|
|
|
|
}
|
|
|
|
|
|
|
|
if ok := f(); ok {
|
|
|
|
println("it's NOT empty!")
|
|
|
|
} else { // MATCH /this block is empty, you can remove it/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for i := 0; i < 10; i++ { // MATCH /this block is empty, you can remove it/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for { // MATCH /this block is empty, you can remove it/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|