MCPcopy
hub / github.com/rs/zerolog / decodeIfBinary

Function decodeIfBinary

hlog/hlog_test.go:22–28  ·  view source on GitHub ↗
(out *bytes.Buffer)

Source from the content-addressed store, hash-verified

20)
21
22func decodeIfBinary(out *bytes.Buffer) string {
23 p := out.Bytes()
24 if len(p) == 0 || p[0] < 0x7F {
25 return out.String()
26 }
27 return cbor.DecodeObjectToStr(p) + "\n"
28}
29
30func TestNewHandler(t *testing.T) {
31 log := zerolog.New(nil).With().

Callers 15

TestURLHandlerFunction · 0.85
TestMethodHandlerFunction · 0.85
TestRequestHandlerFunction · 0.85
TestRemoteAddrHandlerFunction · 0.85
TestRemoteIPHandlerFunction · 0.85
TestRemoteIPHandlerIPv6Function · 0.85
TestUserAgentHandlerFunction · 0.85
TestRefererHandlerFunction · 0.85
TestRequestIDHandlerFunction · 0.85
TestCustomHeaderHandlerFunction · 0.85
TestEtagHandlerFunction · 0.85

Calls 3

DecodeObjectToStrFunction · 0.92
BytesMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected