fix typo issue

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2025-05-09 11:39:26 +08:00
parent ca32ebdb0b
commit cac167a020
3 changed files with 4 additions and 4 deletions

View File

@ -15,5 +15,5 @@ const (
GoccyGoYaml = "HELMFILE_GOCCY_GOYAML"
CacheHome = "HELMFILE_CACHE_HOME"
Interactive = "HELMFILE_INTERACTIVE"
EanbleGoccyGoYamlJsonStyle = "HELMFILE_ENABLE_GOCCY_GOYAML_JSON_STYLE"
EnableGoccyGoYamlJSONStyle = "HELMFILE_ENABLE_GOCCY_GOYAML_JSON_STYLE"
)

View File

@ -248,10 +248,10 @@ func TestToYaml(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if tt.enableJsonStyle {
_ = os.Setenv(envvar.EanbleGoccyGoYamlJsonStyle, "true")
_ = os.Setenv(envvar.EnableGoccyGoYamlJSONStyle, "true")
}
defer func() {
_ = os.Unsetenv(envvar.EanbleGoccyGoYamlJsonStyle)
_ = os.Unsetenv(envvar.EnableGoccyGoYamlJSONStyle)
}()
actual, err := ToYaml(tt.input)
if tt.wantErr {

View File

@ -74,7 +74,7 @@ func Marshal(v any) ([]byte, error) {
yaml.UseLiteralStyleIfMultiline(true),
}
// enable JSON style if the envvar is set
if os.Getenv(envvar.EanbleGoccyGoYamlJsonStyle) == "true" {
if os.Getenv(envvar.EnableGoccyGoYamlJSONStyle) == "true" {
yamlEncoderOpts = append(yamlEncoderOpts, yaml.JSON(), yaml.Flow(false))
}