Actually unparse field names

Instead of just wrapping in "".
This commit is contained in:
Stanisław Barzowski 2017-09-07 12:44:35 -04:00 committed by Dave Cunningham
parent 860c3e6e70
commit 6b040a9afe
3 changed files with 14 additions and 3 deletions

View File

@ -591,9 +591,7 @@ func (i *interpreter) manifestJSON(trace *TraceElement, v value, multiline bool,
buf.WriteString(prefix)
buf.WriteString(indent2)
buf.WriteString("\"")
buf.WriteString(fieldName)
buf.WriteString("\"")
buf.WriteString(unparseString(fieldName))
buf.WriteString(": ")
// TODO(sbarzowski) body.Loc()

5
testdata/escaped_fields.golden vendored Normal file
View File

@ -0,0 +1,5 @@
{
"\n\n": null,
"\"": null,
"'": null
}

8
testdata/escaped_fields.input vendored Normal file
View File

@ -0,0 +1,8 @@
{
'"': null,
"'": null,
|||
|||: null,
}