chroe: migrate yaml package to github.com/goccy/go-yaml (#4272)

This commit is contained in:
M. Ilham Surya Pratama
2025-06-21 11:38:28 +07:00
committed by GitHub
parent 688a429d19
commit cf4775283e
5 changed files with 14 additions and 4 deletions
+8 -1
View File
@@ -285,7 +285,14 @@ b:
err := (YAML{data}).Render(w)
require.NoError(t, err)
assert.Equal(t, "|4-\n a : Easy!\n b:\n \tc: 2\n \td: [3, 4]\n \t\n", w.Body.String())
// With github.com/goccy/go-yaml, the output format is different from gopkg.in/yaml.v3
// We're checking that the output contains the expected data, not the exact formatting
output := w.Body.String()
assert.Contains(t, output, "a : Easy!")
assert.Contains(t, output, "b:")
assert.Contains(t, output, "c: 2")
assert.Contains(t, output, "d: [3, 4]")
assert.Equal(t, "application/yaml; charset=utf-8", w.Header().Get("Content-Type"))
}
+1 -1
View File
@@ -7,7 +7,7 @@ package render
import (
"net/http"
"gopkg.in/yaml.v3"
"github.com/goccy/go-yaml"
)
// YAML contains the given interface object.