(id int64, f StructField)
| 511 | } |
| 512 | |
| 513 | func protoStructField(id int64, f StructField) (*exprpb.Expr_CreateStruct_Entry, error) { |
| 514 | v, err := ExprToProto(f.Value()) |
| 515 | if err != nil { |
| 516 | return nil, err |
| 517 | } |
| 518 | return &exprpb.Expr_CreateStruct_Entry{ |
| 519 | Id: id, |
| 520 | KeyKind: &exprpb.Expr_CreateStruct_Entry_FieldKey{ |
| 521 | FieldKey: f.Name(), |
| 522 | }, |
| 523 | Value: v, |
| 524 | OptionalEntry: f.IsOptional(), |
| 525 | }, nil |
| 526 | } |
| 527 | |
| 528 | // SourceInfoToProto serializes an ast.SourceInfo value to a protobuf SourceInfo object. |
| 529 | func SourceInfoToProto(info *SourceInfo) (*exprpb.SourceInfo, error) { |
no test coverage detected