Skip to content

Commit

Permalink
iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Nov 11, 2023
1 parent f29a5db commit 53833ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pkg/mlrval/mlrmap_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ func (mlrmap *Mlrmap) marshalJSONAuxSingleLine(
for pe := mlrmap.Head; pe != nil; pe = pe.Next {
// Write the key which is necessarily string-valued in Miller, and in
// JSON for that matter :)
buffer.WriteString("\"")
encoded := string(millerJSONEncodeString(pe.Key))
buffer.WriteString(colorizer.MaybeColorizeKey(encoded, outputIsStdout))
buffer.WriteString("\": ")
buffer.WriteString(": ")

// Write the value which is a mlrval
valueString, err := pe.Value.marshalJSONAux(jsonFormatting, elementNestingDepth+1, outputIsStdout)
Expand Down
4 changes: 2 additions & 2 deletions test/cases/io-jsonl-io/0031/expout
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{"abcdef ghi": "jkl\nmno\rpqr\tstu\"vw\\xyz"}
{"abcdef ghi": "jkl\nmno\rpqr\tstu\"vw\\\\xyz"}
{"abc\bdef\fghi": "jkl\nmno\rpqr\tstu\"vw\\xyz"}
{"abc\bdef\fghi": "jkl\nmno\rpqr\tstu\"vw\\\\xyz"}
2 changes: 1 addition & 1 deletion test/cases/io-jsonl-io/0036/expout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{""a\"b\"c"": "d\"e\"f"}
{"a\"b\"c": "d\"e\"f"}

0 comments on commit 53833ba

Please sign in to comment.