diff options
| author | historia <[not public]> | 2026-10-05 18:16:47 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 18:16:47 -0400 |
| commit | 9d8c43cd68c960b9a6b8f781684f763e204a4498 (patch) | |
| tree | c9e2a02094a8700db29db2768a0d058ce259a4f4 /internal/admin/api_helpers.go | |
| parent | 7a15a5d70004b28bf2a710fa0f536af2446e5b17 (diff) | |
| download | thehouseoficarus-9d8c43cd68c960b9a6b8f781684f763e204a4498.tar.gz | |
fix: shared YAML encoder and journal directory, text cleanup
Diffstat (limited to 'internal/admin/api_helpers.go')
| -rw-r--r-- | internal/admin/api_helpers.go | 12 |
1 files changed, 2 insertions, 10 deletions
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) } |
