Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: tison <wander4096@gmail.com>
pull/31431/head
tison 6 days ago committed by GitHub
parent 3bab4ac504
commit b7c03dabf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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 {

@ -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() }{},
}

Loading…
Cancel
Save