> On Fri, 14 Feb 2025 at 14:24, Axel Wagner <[email protected]>
> wrote:
>
>> On Fri, 14 Feb 2025 at 14:05, Jason E. Aten <[email protected]> wrote:
>>
>>> I myself still use the classic string based-errors as
>>> original designed.
>>>
>>
>> I'm not sure what you mean here.
>>
>
I'm sorry to be confusing. I'm not doing anything tricky or sophisticated
at all.
I simply meant that I create errors with fmt.Errorf, ala `var ErrCtxRain =
fmt.Errorf("context cancelled due to rain")`;
search them with strings.Contains(err.Error(),"i/o timeout")); and compare
them with ==, ala `if err == io.EOF || err == ErrCtxRain { ...`
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/golang-nuts/CAPNEFAbdWA9E0q7jD_JaO8zB%2Bn7szURmAgNRj90QHR-nczLjtg%40mail.gmail.com.