MCPcopy Create free account
hub / github.com/Facets-cloud/flow / RenderJSON

Function RenderJSON

internal/listfmt/listfmt.go:187–191  ·  view source on GitHub ↗

RenderJSON encodes v as indented JSON. Callers should pass a slice of concrete structs (or maps) — json.Marshal handles key ordering for structs based on field declaration order, giving a stable output.

(w io.Writer, v any)

Source from the content-addressed store, hash-verified

185// concrete structs (or maps) — json.Marshal handles key ordering for structs
186// based on field declaration order, giving a stable output.
187func RenderJSON(w io.Writer, v any) error {
188 enc := json.NewEncoder(w)
189 enc.SetIndent("", " ")
190 return enc.Encode(v)
191}
192
193// RenderTSV emits a tab-separated values stream with a header row.
194func RenderTSV(w io.Writer, headers []string, rows [][]string) error {

Callers 2

runJSONFunction · 0.92
TestRenderJSONFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestRenderJSONFunction · 0.68