1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00
This commit is contained in:
chavacava
2024-08-21 10:38:34 +02:00
committed by GitHub
parent 251470be6a
commit 6a139caf92
2 changed files with 18 additions and 1 deletions

17
testdata/defer.go vendored
View File

@@ -47,3 +47,20 @@ func f() {
return nil
})
}
// Issue #1029
func verify2(a any) func() {
return func() {
fn := a.(func() error)
if err := fn(); err != nil {
panic(err)
}
}
}
func mainf() {
defer verify2(func() error { // MATCH /prefer not to defer chains of function calls/
return nil
})()
}