elvish/pkg/testutil/recover.go

8 lines
108 B
Go

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