Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2025-06-03 Thread 'Axel Wagner' via golang-nuts
On Tue, 3 Jun 2025 at 22:17, tapi...@gmail.com wrote: > Or better, use ErrType instead of *ErrType, so that no need to declare the > global error var. > Doing that is problematic. If the `Error` method is declared with a value receiver, it is promoted to the pointer-type as well. At that point,

Re: [go-nuts] Gopherconf South Africa

2025-06-03 Thread Ian Lance Taylor
This message to golang-nuts was blocked as spam for some reason. Trying again. Ian On Tue, Jun 3, 2025 at 2:14 PM Ian Lance Taylor wrote: > > On Tue, Jun 3, 2025 at 1:58 PM Gopherconf wrote: > > > > How do we add our conference www.gopherconf.co.za to your list of > > conferences? To edit the

[go-nuts] Gopherconf South Africa

2025-06-03 Thread Gopherconf
Hi, How do we add our conference www.gopherconf.co.za to your list of conferences? Thanks, Theo -- 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 golang-nuts+u

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2025-06-03 Thread tapi...@gmail.com
On Wednesday, June 4, 2025 at 3:59:20 AM UTC+8 Axel Wagner wrote: They can just define a singleton sentinel of the error type. e.g. do type errValue struct{} func (e *errValue) Error() string { return "…" } var valueErr = new(errValue) if errors.Is(err, valueErr) { … } No need to define new AP

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2025-06-03 Thread 'Axel Wagner' via golang-nuts
They can just define a singleton sentinel of the error type. e.g. do type errValue struct{} func (e *errValue) Error() string { return "…" } var valueErr = new(errValue) if errors.Is(err, valueErr) { … } No need to define new API, if this can just be solved by fixing the code. Perhaps there shou

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2025-06-03 Thread tapi...@gmail.com
On Tuesday, June 3, 2025 at 8:58:10 PM UTC+8 Bushnell, Thomas wrote: Why do you think these are incorrect uses of errors.Is? If you are only testing the Boolean value, Is is fine and the same as As; you should only use As if you are actually going to use the identified error value in some way

RE: [go-nuts] Comparison of pointers to distinct zero-sized variables

2025-06-03 Thread 'Bushnell, Thomas' via golang-nuts
Why do you think these are incorrect uses of errors.Is? If you are only testing the Boolean value, Is is fine and the same as As; you should only use As if you are actually going to use the identified error value in some way. From: golang-nuts@googlegroups.com On Behalf Of tapi...@gmail.com Se