[#65] object: Fix SetMarshalData for PutSingle request

Allow to reset marshal data

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-02-15 15:38:48 +03:00
parent 2a124b95bc
commit 634e24aba7
2 changed files with 7 additions and 6 deletions

View file

@ -287,6 +287,11 @@ func NestedStructureSetMarshalData[T any, M setMarshalData[T]](field int64, pare
return 0
}
if parentData == nil {
v.SetMarshalData(nil)
return 0
}
n := v.StableSize()
buf := make([]byte, binary.MaxVarintLen64)
prefix := protowire.EncodeTag(protowire.Number(field), protowire.BytesType)