1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-21 17:16:40 +02:00
revive/testdata/defer_loop_disabled.go
2024-11-11 19:31:18 +01:00

29 lines
469 B
Go

package fixtures
import "errors"
type tt int
func (t tt) m() {}
func deferrer1() {
for {
go func() {
defer println()
}()
defer func() {}()
}
defer tt.m() // MATCH /be careful when deferring calls to methods without pointer receiver/
defer func() error {
return errors.New("error") //MATCH /return in a defer function has no effect/
}()
defer recover()
recover() //MATCH /recover must be called inside a deferred function/
defer deferrer()
}