1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-10 03:17:11 +02:00
revive/testdata/defer-only-loop-enabled.go

29 lines
323 B
Go
Raw Normal View History

2020-05-24 20:49:49 +02:00
package fixtures
import "errors"
type tt int
func (t tt) m() {}
func deferrer3() {
for {
go func() {
defer println()
}()
defer func() {}() // MATCH /prefer not to defer inside loops/
}
defer tt.m()
defer func() error {
return errors.New("error")
}()
defer recover()
recover()
defer deferrer()
}