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

Quote strings with special characters in flow mode. #270

Merged
merged 1 commit into from Oct 26, 2022

Conversation

igorpeshansky
Copy link
Contributor

fix #269

related PR : #158

This was designed for correctness — I don't know how this would affect performance.

@igorpeshansky
Copy link
Contributor Author

@goccy Any thoughts on this PR? Thanks.

@@ -623,19 +626,18 @@ func (e *Encoder) encodeStruct(ctx context.Context, value reflect.Value, column
// omit encoding
continue
}
value, err := e.encodeValue(ctx, fieldValue, column)
ve := e
Copy link
Owner

@goccy goccy Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I completely missed this. This is to ensure that the value is encoded with flow style even f the base encoder doesn't set it, without modifying the base encoder. Should I add a comment to that effect?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see ! Thank you for the reply.

@goccy
Copy link
Owner

goccy commented Jan 11, 2022

Thank you for your contribution! It looks good! I commented only in one place.

@goccy
Copy link
Owner

goccy commented Oct 26, 2022

LGTM ! Thank you for the contribution !!

@goccy goccy merged commit bc437e1 into goccy:master Oct 26, 2022
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

Successfully merging this pull request may close these issues.

Strings are not escaped properly when marshalling in flow mode
2 participants