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

Encoder namespace bug #1

Closed
wants to merge 3 commits into from
Closed

Encoder namespace bug #1

wants to merge 3 commits into from

Conversation

jkanywhere
Copy link
Owner

Demonstrate jsonEncoder and MapObjectEncoder differences

Add test cases to demonstrate uber-go#554,
how jsonEncoder and MapObjectEncoder handle namespaces differently.

Specifically: When foo.MarshalLogObject uses OpenNamespace,
jsonEncoder.AddObject does not close the namespace.

Wrap each encoder test case with t.Run for improved test output and
ability to selectively run specific sub tests.
Add test cases to demonstrate uber-go#554,
how jsonEncoder and MapObjectEncoder handle namespaces differently.

Specifically: When foo.MarshalLogObject uses OpenNamespace,
jsonEncoder.AddObject does not close the namespace.
@jkanywhere
Copy link
Owner Author

I'm not entirely sure the point of testing ArrayEncoder with maybeNamespace.
I think perhaps maybeNamespace should implement ArrayMarshaler.

@jkanywhere
Copy link
Owner Author

Superseded by uber-go#1017

@jkanywhere jkanywhere closed this Oct 3, 2021
@sammyrnycreal
Copy link

@jkanywhere Thanks for the test cases. It made finding the issue easier.

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