On Mon, Sep 20, 2021 at 10:52 PM Andrey T.
wrote:
>
> ... or, to put a crazy idea out there, we need to ask for extension of
> switch statement to support (v, err) tuples for a case argument...
That's not a particularly crazy idea. It's just one that's unlikely to make
it through with one use-c
... or, to put a crazy idea out there, we need to ask for extension of
switch statement to support (v, err) tuples for a case argument...
On Sunday, September 19, 2021 at 3:43:36 PM UTC-6 david@gmail.com wrote:
> On Sun, Sep 19, 2021 at 5:19 PM roger peppe wrote:
>
>> In some ways, the exis
On Sun, Sep 19, 2021 at 5:19 PM roger peppe wrote:
> In some ways, the existing API is arguably more ergonomic than the
> originally proposed generic version, as it's possible to use `errors.As` in
> a switch statement (eg to test several possible types of error) which isn't
> possible with the m
In some ways, the existing API is arguably more ergonomic than the
originally proposed generic version, as it's possible to use `errors.As` in
a switch statement (eg to test several possible types of error) which isn't
possible with the multi-return `As` variant.
A minor variant of the existing AP
On Sun, Sep 19, 2021 at 4:02 PM David Finkel wrote:
> You might be interested in the original draft proposal for errors.As:
>
> https://go.googlesource.com/proposal/+/master/design/go2draft-error-inspection.md#the-is-and-as-functions
>
> In particular, it originally specified that errors.As would
You might be interested in the original draft proposal for errors.As:
https://go.googlesource.com/proposal/+/master/design/go2draft-error-inspection.md#the-is-and-as-functions
In particular, it originally specified that errors.As would take a
type-parameter. (the version of generics that was propo