()
| 453 | } |
| 454 | |
| 455 | func (enc *jsonEncoder) addElementSeparator() { |
| 456 | last := enc.buf.Len() - 1 |
| 457 | if last < 0 { |
| 458 | return |
| 459 | } |
| 460 | switch enc.buf.Bytes()[last] { |
| 461 | case '{', '[', ':', ',', ' ': |
| 462 | return |
| 463 | default: |
| 464 | enc.buf.AppendByte(',') |
| 465 | if enc.spaced { |
| 466 | enc.buf.AppendByte(' ') |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | func (enc *jsonEncoder) appendFloat(val float64, bitSize int) { |
| 472 | enc.addElementSeparator() |
no test coverage detected