NewObject creates a CreateStruct instruction for an object with a given type name and optional set of field initializers.
(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry)
| 438 | // NewObject creates a CreateStruct instruction for an object with a given type name and |
| 439 | // optional set of field initializers. |
| 440 | func (ah *adaptingHelper) NewObject(typeName string, fieldInits ...*exprpb.Expr_CreateStruct_Entry) *exprpb.Expr { |
| 441 | adaptedEntries := make([]ast.EntryExpr, len(fieldInits)) |
| 442 | for i, e := range fieldInits { |
| 443 | adaptedEntries[i] = mustAdaptToEntryExpr(e) |
| 444 | } |
| 445 | return mustAdaptToProto(ah.modernHelper.NewStruct(typeName, adaptedEntries...)) |
| 446 | } |
| 447 | |
| 448 | // NewObjectFieldInit creates a new Object field initializer from the field name and value. |
| 449 | func (ah *adaptingHelper) NewObjectFieldInit(field string, init *exprpb.Expr, optional bool) *exprpb.Expr_CreateStruct_Entry { |
nothing calls this directly
no test coverage detected