From 9d8c43cd68c960b9a6b8f781684f763e204a4498 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 18:16:47 -0400 Subject: fix: shared YAML encoder and journal directory, text cleanup --- internal/admin/api_helpers.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'internal/admin/api_helpers.go') diff --git a/internal/admin/api_helpers.go b/internal/admin/api_helpers.go index d5e23c3..2aa75f9 100644 --- a/internal/admin/api_helpers.go +++ b/internal/admin/api_helpers.go @@ -8,6 +8,7 @@ import ( "gopkg.in/yaml.v3" + "thehouseoficarus/internal/behavior" "thehouseoficarus/internal/persistence" "thehouseoficarus/internal/world" ) @@ -121,14 +122,5 @@ func writeMapAsYAML(path string, m map[string]any) ([]byte, error) { // marshalMapYAML serializes a generic map without writing: callers that // only need the after-image (mutation-plan preflight) use this. func marshalMapYAML(m map[string]any) ([]byte, error) { - var buf bytes.Buffer - enc := yaml.NewEncoder(&buf) - enc.SetIndent(2) - if err := enc.Encode(m); err != nil { - return nil, err - } - if err := enc.Close(); err != nil { - return nil, err - } - return buf.Bytes(), nil + return behavior.MarshalYAMLMap(m) } -- cgit v1.2.3