decodeOutput converts the buffer contents to a JSON string, handling CBOR-encoded output when built with the binary_log tag.
(buf *bytes.Buffer)
| 21 | // decodeOutput converts the buffer contents to a JSON string, |
| 22 | // handling CBOR-encoded output when built with the binary_log tag. |
| 23 | func decodeOutput(buf *bytes.Buffer) string { |
| 24 | p := buf.Bytes() |
| 25 | if len(p) == 0 || p[0] < 0x7F { |
| 26 | return buf.String() |
| 27 | } |
| 28 | return cbor.DecodeObjectToStr(p) + "\n" |
| 29 | } |
| 30 | |
| 31 | func decodeJSON(t *testing.T, buf *bytes.Buffer) map[string]interface{} { |
| 32 | t.Helper() |
no test coverage detected