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

Method Hex

ext/formatting.go:572–581  ·  view source on GitHub ↗

Hex implements formatStringInterpolator.Hex.

(useUpper bool)

Source from the content-addressed store, hash-verified

570
571// Hex implements formatStringInterpolator.Hex.
572func (c *stringFormatChecker) Hex(useUpper bool) func(ref.Val, string) (string, error) {
573 return func(arg ref.Val, locale string) (string, error) {
574 id := c.args[c.currArgIndex].ID()
575 valid := c.verifyTypeOneOf(id, types.IntType, types.UintType, types.StringType, types.BytesType)
576 if !valid {
577 return "", hexFormatError(id, c.typeOf(id).TypeName())
578 }
579 return "", nil
580 }
581}
582
583// Octal implements formatStringInterpolator.Octal.
584func (c *stringFormatChecker) Octal(arg ref.Val, locale string) (string, error) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected