-
Notifications
You must be signed in to change notification settings - Fork 9
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
Initial generic rethinkdb store #539
base: master
Are you sure you want to change the base?
Conversation
You use This makes the API a little akward: Take the func (rs *rethinkStore[E]) Create(ctx context.Context, e E) error If you only look at the signature you do not see that the last parameter has to be a pointer to a type. Imho it is also not a very good style to have such an output parameter. Why not have a signature like func (rs *rethinkStore[E]) Create(ctx context.Context) (*E, error) In this case it is clear that you return a pointer to your type parameter. But this requires your type constraint to be more tricky: I think you need two type parameters. One for the type without a constraint and the second with our The type parameters proposal has a good example for this problem. |
Just to see how this would feel