aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_helpers.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-05 18:16:47 -0400
committerhistoria <[not public]>2026-10-05 18:16:47 -0400
commit9d8c43cd68c960b9a6b8f781684f763e204a4498 (patch)
treec9e2a02094a8700db29db2768a0d058ce259a4f4 /internal/admin/api_helpers.go
parent7a15a5d70004b28bf2a710fa0f536af2446e5b17 (diff)
downloadthehouseoficarus-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.go12
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)
}