elvish/pkg/testutil/recover.go

8 lines
100 B
Go

package testutil
func Recover(f func()) (r any) {
defer func() { r = recover() }()
f()
return
}