interface identity (was Re: Proposed new dependency: github.com/juju/errors (and github.com/juju/errgo))
roger peppe
roger.peppe at canonical.com
Wed May 28 13:13:57 UTC 2014
I just saw this thread after replying to the other one.
Fundamentally, I think comparing errors for equality
is misguided. That said, a simple approach that
doesn't use DeepEquals is possible:
func sameError(e1, e2 error) bool {
defer func() { recover() }()
return e1 == e2
}
On 28 May 2014 05:16, Tim Penhey <tim.penhey at canonical.com> wrote:
> On 28/05/14 15:48, John Meinel wrote:
>> I think we need concrete examples which Tim should have in the test suite.
>>
>> John
>> =:->
>>
>> On May 28, 2014 6:50 AM, "Andrew Wilkins" <andrew.wilkins at canonical.com
>> <mailto:andrew.wilkins at canonical.com>> wrote:
>>
>> On Wed, May 28, 2014 at 10:39 AM, John Meinel
>> <john at arbash-meinel.com <mailto:john at arbash-meinel.com>> wrote:
>>
>> The address of the real value is the same.
>>
>> Are you referring to the backing array? That is not what is being
>> compared, so that's not a useful property.
>
> FWIW, replacing the icky unsafe bits with reflect.DeepEqual does work
> but it just leaves me with an icky taste in my mouth.
>
> Admittedly less icky than the unsafe work.
>
> Tim
>
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
More information about the Juju-dev
mailing list