-
Notifications
You must be signed in to change notification settings - Fork 205
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: use Go-syntax representation to generate description #471
fix: use Go-syntax representation to generate description #471
Conversation
Generated code cannot be built if the field's comment has an invalid escape sequence (ex. `\.`). This commit fixes this issue by replacing current description escape logic with `strconv.Quote` to properly escape characters in string. Signed-off-by: Sunghoon Kang <me@hoon.dev>
Welcome @devholic! |
kubernetes#471 (comment) Signed-off-by: Sunghoon Kang <me@hoon.dev>
strconv.Quote
to generate description
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, devholic The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
if %#v correct or should it be %q? I think we might be getting double escapes, see the generated update in kubernetes/kubernetes#124632 old:
new:
|
I think %#v is correct here and that the old behavior to remove the
I believe the backslashes are intended, since the VAP audit annotations encode JSON as a string value and it would be incorrect for the docs to claim it is part of the structure of the audit annotations map |
Generated code cannot be built if the field's comment has an invalid escape sequence (ex.
\.
).This PR fixes this issue by replacing current description escape logic with using Go-syntax representation (
%#v
) to properly escape characters in string.