Closed gpaul closed 6 years ago
goderive does some check for equal methods on structs, but maybe goderive could do checks on other types as well. I'll look into making sure this works.
Wow that was fast, thank you! Works like a charm.
My pleasure :) It was an easy fix.
If you are using it in some project, we would love to add that project to your users list, if possible?
Sigh for the moment it is closed source, sorry. We plan on open sourcing part of it in the next few months though.
No problem. Just trying my luck :)
If you're happy with just "used by XXX" then I'll let you know once we release the closed source version, right now the project is in early development.
Also happy to add used by XXX with a link to the closed source project.
@awalterschulze Hi, I think we should use Equal() before using “==” if Equal is defined for T. This is because if T changes, we can’t use “==” and it may only be equal through Equal().
Would you like to create a new issue with a more elaborate description, I don't think I fully understand
I would like to generate
deriveEqual
for the following type hierarchy:Now, as it is not possible to derive an
Equal
for aninterface{}
this fails. However, I would like to implementfunc (Bar) Equal(other Bar) bool {}
myself and havederiveEqual
notice that and call it instead.That way I can take responsibility for the fact that I end up calling
reflect.DeepEqual()
or implementing customEqual
logic lower down my type hierarchy while still benefiting from all the lovely code generation for the rest of it.