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

Function protoSelect

common/ast/conversion.go:476–491  ·  view source on GitHub ↗
(id int64, s SelectExpr)

Source from the content-addressed store, hash-verified

474}
475
476func protoSelect(id int64, s SelectExpr) (*exprpb.Expr, error) {
477 op, err := ExprToProto(s.Operand())
478 if err != nil {
479 return nil, err
480 }
481 return &exprpb.Expr{
482 Id: id,
483 ExprKind: &exprpb.Expr_SelectExpr{
484 SelectExpr: &exprpb.Expr_Select{
485 Operand: op,
486 Field: s.FieldName(),
487 TestOnly: s.IsTestOnly(),
488 },
489 },
490 }, nil
491}
492
493func protoStruct(id int64, s StructExpr) (*exprpb.Expr, error) {
494 entries := make([]*exprpb.Expr_CreateStruct_Entry, len(s.Fields()))

Callers 1

ExprToProtoFunction · 0.85

Calls 4

ExprToProtoFunction · 0.85
OperandMethod · 0.65
FieldNameMethod · 0.65
IsTestOnlyMethod · 0.65

Tested by

no test coverage detected