(id int64, s StructExpr)
| 491 | } |
| 492 | |
| 493 | func protoStruct(id int64, s StructExpr) (*exprpb.Expr, error) { |
| 494 | entries := make([]*exprpb.Expr_CreateStruct_Entry, len(s.Fields())) |
| 495 | var err error |
| 496 | for i, e := range s.Fields() { |
| 497 | entries[i], err = EntryExprToProto(e) |
| 498 | if err != nil { |
| 499 | return nil, err |
| 500 | } |
| 501 | } |
| 502 | return &exprpb.Expr{ |
| 503 | Id: id, |
| 504 | ExprKind: &exprpb.Expr_StructExpr{ |
| 505 | StructExpr: &exprpb.Expr_CreateStruct{ |
| 506 | MessageName: s.TypeName(), |
| 507 | Entries: entries, |
| 508 | }, |
| 509 | }, |
| 510 | }, nil |
| 511 | } |
| 512 | |
| 513 | func protoStructField(id int64, f StructField) (*exprpb.Expr_CreateStruct_Entry, error) { |
| 514 | v, err := ExprToProto(f.Value()) |
no test coverage detected