Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Recursive Functions to take extra function parameters for private fields #55

Open
awalterschulze opened this issue Feb 24, 2019 · 7 comments

Comments

@awalterschulze
Copy link
Owner

For example

deriveEqual(T, T, func(A, A) bool, func(B, B) bool) bool

, where T contains a field with type A and B

@awalterschulze
Copy link
Owner Author

This also includes:

  • Compare
  • Clone
  • DeepCopy
  • GoString
  • Hash

This can be especially useful for time.Time, which has loads of private fields, but can be easily handled with a special case function.

Tackling a single one of these would be greatly appreciated.

@awalterschulze
Copy link
Owner Author

The idea is when you traverse through the struct and find a field that matches the input type of one of the input functions, you should rather use the function provided in the parameter recursing deeper.
This almost the same as calling the Equal method rather than generating your own.

@awalterschulze
Copy link
Owner Author

This is the generic version of issue #47

@OladapoAjala
Copy link
Contributor

OladapoAjala commented Apr 25, 2022

@awalterschulze is the generic version solved or it is still open?

@awalterschulze
Copy link
Owner Author

There is a lot of discussion about how to solve the generic version in #47
If you are interested, I don't think any work has been done yet

@OladapoAjala
Copy link
Contributor

Nice, I'm interested in tackling the generic version, sounds fun to me!

@awalterschulze
Copy link
Owner Author

Go for it, first make sure you understand what has been agreed upon in #47
Do a small prototype, to make sure you don't do too much work before checking that we are on the same page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants