MCPcopy Index your code
hub / github.com/segmentio/encoding / escapeByteRepr

Function escapeByteRepr

json/string.go:43–60  ·  view source on GitHub ↗
(b byte)

Source from the content-addressed store, hash-verified

41}
42
43func escapeByteRepr(b byte) byte {
44 switch b {
45 case '\\', '"':
46 return b
47 case '\b':
48 return 'b'
49 case '\f':
50 return 'f'
51 case '\n':
52 return 'n'
53 case '\r':
54 return 'r'
55 case '\t':
56 return 't'
57 }
58
59 return 0
60}
61
62// below return a mask that can be used to determine if any of the bytes
63// in `n` are below `b`. If a byte's MSB is set in the mask then that byte was

Callers 1

encodeStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…