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

Function maybeUnwrapString

checker/checker.go:660–670  ·  view source on GitHub ↗
(e ast.Expr)

Source from the content-addressed store, hash-verified

658}
659
660func maybeUnwrapString(e ast.Expr) (string, bool) {
661 switch e.Kind() {
662 case ast.LiteralKind:
663 literal := e.AsLiteral()
664 switch v := literal.(type) {
665 case types.String:
666 return string(v), true
667 }
668 }
669 return "", false
670}
671
672func (c *checker) setType(e ast.Expr, t *types.Type) {
673 if old, found := c.TypeMap()[e.ID()]; found && !old.IsExactType(t) {

Callers 1

checkOptSelectMethod · 0.85

Calls 2

KindMethod · 0.65
AsLiteralMethod · 0.65

Tested by

no test coverage detected