Fix SetMarshalData for PutSingle request #65

Merged
dstepanov-yadro merged 1 commits from dstepanov-yadro/frostfs-api-go:fix/put_single_request_marshal_data into master 2024-02-15 14:10:46 +00:00

Allow to reset marshal data also for put single request

Allow to reset marshal data also for put single request
dstepanov-yadro added 1 commit 2024-02-15 12:41:09 +00:00
DCO action / DCO (pull_request) Successful in 1m2s Details
Tests and linters / Tests (1.19) (pull_request) Successful in 1m28s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 1m34s Details
Tests and linters / Lint (pull_request) Successful in 1m45s Details
Tests and linters / Tests with -race (pull_request) Successful in 2m2s Details
4cafb5342c
[#65] marshal: Fix SetMarshalData for PutSingle request
Allow to reset marshal data

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
dstepanov-yadro force-pushed fix/put_single_request_marshal_data from 4cafb5342c to 2e83fecbdc 2024-02-15 12:42:37 +00:00 Compare
dstepanov-yadro requested review from storage-core-committers 2024-02-15 12:42:49 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-02-15 12:42:50 +00:00
dstepanov-yadro force-pushed fix/put_single_request_marshal_data from 2e83fecbdc to 634e24aba7 2024-02-15 12:44:16 +00:00 Compare
fyrchik reviewed 2024-02-15 12:44:36 +00:00
@ -287,6 +287,11 @@ func NestedStructureSetMarshalData[T any, M setMarshalData[T]](field int64, pare
return 0
}
if parentData == nil {

How is this related?

How is this related?
Poster
Collaborator

Now r.marshalData can be nil

func (r *PutSingleRequestBody) SetMarshalData(data []byte) {
	if r == nil {
		return
	}

	r.marshalData = data

	proto.NestedStructureSetMarshalData(putSingleReqObjectField, r.marshalData, r.object)
}

So if parentData == nil then we should reset nested marshalData

Now `r.marshalData` can be `nil` ``` func (r *PutSingleRequestBody) SetMarshalData(data []byte) { if r == nil { return } r.marshalData = data proto.NestedStructureSetMarshalData(putSingleReqObjectField, r.marshalData, r.object) } ``` So if `parentData == nil` then we should reset nested marshalData
fyrchik approved these changes 2024-02-15 13:43:08 +00:00
aarifullin approved these changes 2024-02-15 14:07:57 +00:00
dstepanov-yadro merged commit 634e24aba7 into master 2024-02-15 14:10:46 +00:00
dstepanov-yadro deleted branch fix/put_single_request_marshal_data 2024-02-15 14:10:49 +00:00
Sign in to join this conversation.
There is no content yet.