Perhaps explicitly capture the error value? That is,
result, err := GetAsOr[MyObj](services.GetServiceOr())
Alternatively, if you don't care if there is an error replace "err" with
"_" to make that clear.
On Wed, Nov 23, 2022 at 4:34 PM Denis P wrote:
> Hi guys,
>
> Does anyone know how to
Hi guys,
Does anyone know how to pass it properly and without adding extra lines of
code?
```
func GetAsOr[T any](t interface{}, e error) (T, error) {
return t.(T), e
}
func (s ServiceProvider) GetServiceOr() (interface{}, error) {
}
result :=