From f7a6d6519526e9c5b8ab3e1c8f2c2d26f8a3f575 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Sun, 23 Aug 2020 00:53:38 +0900 Subject: [PATCH] Fix new line char --- encode_vm.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/encode_vm.go b/encode_vm.go index 80fce44..a308628 100644 --- a/encode_vm.go +++ b/encode_vm.go @@ -223,7 +223,7 @@ func (e *Encoder) run(code *opcode) error { code.ptr = header.Data } else { e.encodeIndent(code.indent) - e.encodeBytes([]byte{'[', ']', '\n'}) + e.encodeBytes([]byte{'[', ']'}) code = headerCode.end.next } } @@ -259,7 +259,7 @@ func (e *Encoder) run(code *opcode) error { } else { e.encodeByte('\n') e.encodeIndent(code.indent) - e.encodeBytes([]byte{']', '\n'}) + e.encodeByte(']') code = c.end.next } case opRootSliceElemIndent: @@ -421,7 +421,7 @@ func (e *Encoder) run(code *opcode) error { e.encodeIndent(code.indent) } else { e.encodeIndent(code.indent) - e.encodeBytes([]byte{'{', '}', '\n'}) + e.encodeBytes([]byte{'{', '}'}) code = mapHeadCode.end.next } } @@ -447,7 +447,7 @@ func (e *Encoder) run(code *opcode) error { e.encodeIndent(code.indent) } else { e.encodeIndent(code.indent) - e.encodeBytes([]byte{'{', '}', '\n'}) + e.encodeBytes([]byte{'{', '}'}) code = mapHeadCode.end.next } } @@ -487,7 +487,7 @@ func (e *Encoder) run(code *opcode) error { } else { e.encodeByte('\n') e.encodeIndent(code.indent - 1) - e.encodeBytes([]byte{'}', '\n'}) + e.encodeByte('}') code = c.end.next } case opRootMapKeyIndent: @@ -502,7 +502,7 @@ func (e *Encoder) run(code *opcode) error { } else { e.encodeByte('\n') e.encodeIndent(code.indent - 1) - e.encodeBytes([]byte{'}'}) + e.encodeByte('}') code = c.end.next } case opMapValueIndent: