diff --git a/pkg/envvar/const.go b/pkg/envvar/const.go index eb4de609..40de9ae9 100644 --- a/pkg/envvar/const.go +++ b/pkg/envvar/const.go @@ -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" ) diff --git a/pkg/tmpl/context_funcs_test.go b/pkg/tmpl/context_funcs_test.go index 60e181a4..4a75a9c2 100644 --- a/pkg/tmpl/context_funcs_test.go +++ b/pkg/tmpl/context_funcs_test.go @@ -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 { diff --git a/pkg/yaml/yaml.go b/pkg/yaml/yaml.go index e10f916f..1b30da25 100644 --- a/pkg/yaml/yaml.go +++ b/pkg/yaml/yaml.go @@ -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)) }