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

Fix csv marshaller for marshal chan #15

Merged
merged 3 commits into from
Jul 11, 2019

Conversation

joey-clypd
Copy link

The commit message for dbd300f lays out the bulk of the issue, so I won't repeat it here. The context is that I was trying to use MarshalChan in gillnet only to discover that it didn't work as advertised with respect to broadcast.Dates. So, I fixed it.

Please let me know your thoughts on this solution.

The test for writeToChan exemplifies the problem.  Marshallers are
silently getting turned into blank strings.
The call to .Interface() requires an addressable value.  However, the
values that come out of a channel are not necessarily addressable if
they are non-pointer values.  A value is non-addressable if it doesn't
have a stable address (i.e. there is a guarantee that there will be
something meaningful at the address).  This can be interpreted as "an
addressable value is heap allocated".  So, our non-addressable value
is stack allocated.  We can turn it into an addressable value, but
copying it to the heap, which is what this code does.
@joey-clypd joey-clypd merged commit 62b21cd into master Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants