MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / PrintableBytes

Function PrintableBytes

pkg/util/encoding/encoding.go:3302–3304  ·  view source on GitHub ↗

PrintableBytes returns true iff the given byte array is a valid UTF-8 sequence and it is printable.

(b []byte)

Source from the content-addressed store, hash-verified

3300// PrintableBytes returns true iff the given byte array is a valid
3301// UTF-8 sequence and it is printable.
3302func PrintableBytes(b []byte) bool {
3303 return len(bytes.TrimLeftFunc(b, isValidAndPrintableRune)) == 0
3304}
3305
3306func isValidAndPrintableRune(r rune) bool {
3307 return r != utf8.RuneError && unicode.IsPrint(r)

Callers 1

PrettyPrintValueEncodedFunction · 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…