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

Is it possible to add support of struct{}? #14

Closed
ikkeps opened this issue Oct 27, 2015 · 2 comments
Closed

Is it possible to add support of struct{}? #14

ikkeps opened this issue Oct 27, 2015 · 2 comments

Comments

@ikkeps
Copy link

ikkeps commented Oct 27, 2015

In many cases sets implemented as map[T]struct{}. It would be nice to support it to avoid extra convertion on both server and client sides.

Currently Dispatcher AddFunc panics:

... cannot contain struct without exported fields [struct {}] in the value of map...

I could implement custom GobDecoder/GobDecoder for map[T]struct{}-type in my code, but it would be nice if gorpc supports it.

@ikkeps
Copy link
Author

ikkeps commented Oct 27, 2015

I hacked it like this ikkeps@0b4d2f9
Not sure about this. All tests pass and RPC works.

@valyala
Copy link
Owner

valyala commented Oct 29, 2015

@Ikeps, thanks for the patch!

@valyala valyala closed this as completed Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants