Documentation
¶
Overview ¶
Package jsonclose closes truncated JSON documents: the state machine both the OutputDecoder's prefix salvage (partial_json.go) and mw.RepairJSON need. It lived as two hand-maintained copies until the 2026-09-22 0.3.0 review flagged that they had already drifted (the trailing-comma rule differed), and moves here rather than into either public package — THE-END-GOAL principle 3 names internal/ as the tool that keeps the guaranteed surface small, and Go's path-based internal rule lets both the root package and mw import it while third parties cannot (the adapterkit precedent).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶
Close returns s closed over its open strings and brackets — structure only, never value content: a dangling escape is fixed so it cannot eat the closing quote, trailing commas are dropped, and a dangling colon gets a null. The attempt is handed back even when it still is not valid JSON (mw's payload-preservation rule: the bytes the caller sent survive byte-for-byte); valid reports whether it is.
Types ¶
This section is empty.