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

Method Hex

ext/formatting_v2.go:512–521  ·  view source on GitHub ↗

Hex implements formatStringInterpolatorV2.Hex.

(useUpper bool)

Source from the content-addressed store, hash-verified

510
511// Hex implements formatStringInterpolatorV2.Hex.
512func (c *stringFormatCheckerV2) Hex(useUpper bool) func(ref.Val) (string, error) {
513 return func(arg ref.Val) (string, error) {
514 id := c.args[c.currArgIndex].ID()
515 valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType)
516 if !valid {
517 return "", hexFormatErrorV2(id, c.typeOf(id).TypeName())
518 }
519 return "", nil
520 }
521}
522
523// Octal implements formatStringInterpolatorV2.Octal.
524func (c *stringFormatCheckerV2) Octal(arg ref.Val) (string, error) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected