From b7c03dabf9c586438993ad61b93baa910d697cff Mon Sep 17 00:00:00 2001 From: tison Date: Tue, 17 Mar 2026 06:27:37 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: tison --- pkg/engine/funcs.go | 6 +++--- pkg/engine/funcs_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/engine/funcs.go b/pkg/engine/funcs.go index 65956d8aa..7b58e0dc0 100644 --- a/pkg/engine/funcs.go +++ b/pkg/engine/funcs.go @@ -165,9 +165,9 @@ func toTOML(v any) string { // mustToTOML takes an interface, marshals it to toml, and returns a string. // It will panic if there is an error. // -// This is designed to be called from a template when need to ensure that the -// output TOML is valid. -func mustToTOML(v interface{}) string { +// This is designed to be called from a template when you need to ensure that +// the output TOML is valid. +func mustToTOML(v any) string { b := bytes.NewBuffer(nil) e := toml.NewEncoder(b) if err := e.Encode(v); err != nil { diff --git a/pkg/engine/funcs_test.go b/pkg/engine/funcs_test.go index 71adca095..1fe290869 100644 --- a/pkg/engine/funcs_test.go +++ b/pkg/engine/funcs_test.go @@ -135,7 +135,7 @@ keyInElement1 = "valueInElement1"`, assert.Equal(t, tt.expect, b.String(), tt.tpl) } - nonSerializable := map[string]interface{}{ + nonSerializable := map[string]any{ "foo": struct{ Fn func() }{}, }