(barr []byte, indentStr string)
| 766 | } |
| 767 | |
| 768 | func reindentJson(barr []byte, indentStr string) []byte { |
| 769 | if len(barr) < 2 { |
| 770 | return barr |
| 771 | } |
| 772 | if barr[0] != '{' && barr[0] != '[' { |
| 773 | return barr |
| 774 | } |
| 775 | if !bytes.Contains(barr, []byte("\n")) { |
| 776 | return barr |
| 777 | } |
| 778 | outputLines := bytes.Split(barr, []byte("\n")) |
| 779 | for i, line := range outputLines { |
| 780 | if i == 0 { |
| 781 | continue |
| 782 | } |
| 783 | outputLines[i] = append([]byte(indentStr), line...) |
| 784 | } |
| 785 | return bytes.Join(outputLines, []byte("\n")) |
| 786 | } |
| 787 | |
| 788 | func jsonMarshalConfigInOrder(m waveobj.MetaMapType) ([]byte, error) { |
| 789 | if len(m) == 0 { |
no outgoing calls
no test coverage detected