MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Binary

Method Binary

ext/formatting.go:562–569  ·  view source on GitHub ↗

Binary implements formatStringInterpolator.Binary.

(arg ref.Val, locale string)

Source from the content-addressed store, hash-verified

560
561// Binary implements formatStringInterpolator.Binary.
562func (c *stringFormatChecker) Binary(arg ref.Val, locale string) (string, error) {
563 id := c.args[c.currArgIndex].ID()
564 valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.BoolType)
565 if !valid {
566 return "", binaryFormatError(id, c.typeOf(id).TypeName())
567 }
568 return "", nil
569}
570
571// Hex implements formatStringInterpolator.Hex.
572func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) {

Callers

nothing calls this directly

Calls 5

verifyTypeOneOfMethod · 0.95
typeOfMethod · 0.95
binaryFormatErrorFunction · 0.85
IDMethod · 0.65
TypeNameMethod · 0.65

Tested by

no test coverage detected