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

Encode does not respect Style = LiteralStyle #1041

Open
efd6 opened this issue Jul 29, 2024 · 1 comment
Open

Encode does not respect Style = LiteralStyle #1041

efd6 opened this issue Jul 29, 2024 · 1 comment

Comments

@efd6
Copy link

efd6 commented Jul 29, 2024

Running the following program shows the issue; https://go.dev/play/p/dbduWiFiGZO.

Despite setting Style to LiteralStyle for all nodes, the string is printed as a quoted string. The choice of behaviour can be altered by removing some text, though which parts cause the change in behaviour is unclear (for example, this https://go.dev/play/p/AwdkIx8FBSJ gives the desired behaviour with literal string being rendered).

@lixin9311
Copy link

Turns out trailing spaces cause it:

https://go.dev/play/p/3elLZU4cRrV

efd6 added a commit to efd6/integrations that referenced this issue Jan 30, 2025
We see situations where the CEL program is rendered in double quoted
strings in the pre-config.yml in diagnostic bundles, making it
difficult to read. The cause of this has now been identified as the
presence of trailing whitespace on lines[1]. So remove those.

[1]go-yaml/yaml#1041 (comment)
efd6 added a commit to elastic/integrations that referenced this issue Jan 30, 2025
We see situations where the CEL program is rendered in double quoted
strings in the pre-config.yml in diagnostic bundles, making it
difficult to read. The cause of this has now been identified as the
presence of trailing whitespace on lines[1]. So remove those.

[1]go-yaml/yaml#1041 (comment)
harnish-elastic pushed a commit to harnish-elastic/integrations that referenced this issue Feb 4, 2025
We see situations where the CEL program is rendered in double quoted
strings in the pre-config.yml in diagnostic bundles, making it
difficult to read. The cause of this has now been identified as the
presence of trailing whitespace on lines[1]. So remove those.

[1]go-yaml/yaml#1041 (comment)
qcorporation pushed a commit to elastic/integrations that referenced this issue Feb 4, 2025
We see situations where the CEL program is rendered in double quoted
strings in the pre-config.yml in diagnostic bundles, making it
difficult to read. The cause of this has now been identified as the
presence of trailing whitespace on lines[1]. So remove those.

[1]go-yaml/yaml#1041 (comment)
harnish-elastic pushed a commit to harnish-elastic/integrations that referenced this issue Feb 5, 2025
We see situations where the CEL program is rendered in double quoted
strings in the pre-config.yml in diagnostic bundles, making it
difficult to read. The cause of this has now been identified as the
presence of trailing whitespace on lines[1]. So remove those.

[1]go-yaml/yaml#1041 (comment)
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