Skip to content

Conversation

yxxhero
Copy link
Member

@yxxhero yxxhero commented May 13, 2025

This pull request introduces a change to the NewEncoder function in pkg/yaml/yaml.go to support conditional encoding options based on an environment variable. Specifically, it enables JSON-style encoding for YAML when the environment variable EnableGoccyGoYamlJSONStyle is set to true.

Key change:

  • pkg/yaml/yaml.go: Updated the NewEncoder function to include conditional logic that checks the EnableGoccyGoYamlJSONStyle environment variable. If set to true, JSON-style encoding is enabled by adding yaml.JSON() and yaml.Flow(false) options to the encoder.

Signed-off-by: yxxhero <aiopsclub@163.com>
@yxxhero yxxhero requested review from mumoshu and itscaro as code owners May 13, 2025 05:25
@yxxhero yxxhero linked an issue May 13, 2025 that may be closed by this pull request
@yxxhero yxxhero requested review from xiaomudk and zhaque44 as code owners May 13, 2025 05:25
@yxxhero yxxhero merged commit 867bef0 into main May 13, 2025
13 checks passed
@yxxhero yxxhero deleted the 2037-certain-string-numbers-are-incorrectly-turned-into-floats branch May 13, 2025 10:45
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.

Certain string numbers are incorrectly turned into floats
2 participants