refactor: rename the encoder layout options
Test / test (push) Successful in 1m35s

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-22 01:09:00 +02:00
parent bef1d3fbd9
commit d92bb56853
9 changed files with 66 additions and 49 deletions
+2 -2
View File
@@ -295,7 +295,7 @@ const (
// entry is one binding in a tomlDoc. entries live in a single slice in the
// order they were added; emission walks that order directly, either as it is
// (Encoder with GroupByKind(false)) or in kind-grouped passes over the same
// (Encoder with LayoutKindDeclaration) or in kind-grouped passes over the same
// slice (the default).
type entry struct {
kind entryKind
@@ -1157,7 +1157,7 @@ func (e *encoder) writeBlankLine() {
}
func (e *encoder) emitDoc(doc *tomlDoc, prefix []string) error {
if e.opts.groupByKind {
if e.opts.layout == LayoutKindGrouped {
// Scalars first, then inline sub-tables as value lines, then the
// remaining tables as headers, then arrays of tables. Each pass walks
// the entries in place; grouping copies of them cost the encoder a