If you’re using generics you could create a generic type more restrictive than any. For example,
func Wrap[T Foo | Bar](fn func() (T, error)) func() string {
...
}
If you’re using generics you could create a generic type more restrictive than any. For example,
func Wrap[T Foo | Bar](fn func() (T, error)) func() string {
...
}