MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / prettyPrintValueImpl

Function prettyPrintValueImpl

pkg/util/encoding/encoding.go:1451–1479  ·  view source on GitHub ↗
(valDirs []Direction, b []byte, sep string)

Source from the content-addressed store, hash-verified

1449}
1450
1451func prettyPrintValueImpl(valDirs []Direction, b []byte, sep string) (string, bool) {
1452 allDecoded := true
1453 var buf strings.Builder
1454 for len(b) > 0 {
1455 // If there are more values than encoding directions specified,
1456 // valDir will contain the 0 value of Direction.
1457 // prettyPrintFirstValue will then use the default encoding
1458 // direction per each value type.
1459 var valDir Direction
1460 if len(valDirs) > 0 {
1461 valDir = valDirs[0]
1462 valDirs = valDirs[1:]
1463 }
1464
1465 bb, s, err := prettyPrintFirstValue(valDir, b)
1466 if err != nil {
1467 allDecoded = false
1468 buf.WriteString(sep)
1469 buf.WriteByte('?')
1470 buf.WriteByte('?')
1471 buf.WriteByte('?')
1472 } else {
1473 buf.WriteString(sep)
1474 buf.WriteString(s)
1475 }
1476 b = bb
1477 }
1478 return buf.String(), allDecoded
1479}
1480
1481// prettyPrintFirstValue returns a string representation of the first decodable
1482// value in the provided byte slice, along with the remaining byte slice

Callers 1

PrettyPrintValueFunction · 0.85

Calls 2

prettyPrintFirstValueFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…