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

-unexported flag encodes/decodes unexported fields #251

Open
zeldovich opened this issue May 9, 2019 · 1 comment
Open

-unexported flag encodes/decodes unexported fields #251

zeldovich opened this issue May 9, 2019 · 1 comment

Comments

@zeldovich
Copy link

The documentation for msgp -unexported says that it will process unexported types (like type myint int), but it has the unexpected additional behavior of encoding and decoding unexported fields (like type Foo struct { hidden int }). This can be a significant change in behavior in scenarios where the developer was expecting unexported fields to be hidden at encoding time and to be preserved at decoding time.

It would be great to reconcile the documentation with behavior of -unexported, ideally by not encoding/decoding unexported struct fields.

@philhofer
Copy link
Member

I agree the docs should be changed. I'll also add this to the list of warts to be addressed for version 2.

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