session: Unify unmarshaling code #72

Merged
fyrchik merged 1 commit from fyrchik/frostfs-api-go:unify-json-handling into master 2024-04-22 15:01:22 +00:00
Owner

gopatch:

@@
var err, msg, data, t identifier
var obj expression
@@
+import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message"
-import "google.golang.org/protobuf/encoding/protojson"

-msg := obj
-if err := protojson.Unmarshal(data, msg); err != nil {
-return err
-}
-return t.FromGRPCMessage(msg)
+return message.UnmarshalJSON(t, data, obj)

Signed-off-by: Evgenii Stratonikov e.stratonikov@yadro.com

gopatch: ``` @@ var err, msg, data, t identifier var obj expression @@ +import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/message" -import "google.golang.org/protobuf/encoding/protojson" -msg := obj -if err := protojson.Unmarshal(data, msg); err != nil { -return err -} -return t.FromGRPCMessage(msg) +return message.UnmarshalJSON(t, data, obj) ``` Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
fyrchik force-pushed unify-json-handling from 5d800a9df4 to 674c782db5 2024-04-20 11:00:29 +00:00 Compare
fyrchik requested review from storage-core-committers 2024-04-20 11:00:47 +00:00
fyrchik requested review from storage-core-developers 2024-04-20 11:00:49 +00:00
fyrchik force-pushed unify-json-handling from 674c782db5 to 4a330a5706 2024-04-20 11:19:50 +00:00 Compare
acid-ant approved these changes 2024-04-21 18:11:56 +00:00
fyrchik changed title from session: Unify JSON unmarshaling to session: Unify unmarshaling code 2024-04-22 06:48:15 +00:00
aarifullin approved these changes 2024-04-22 08:50:59 +00:00
achuprov approved these changes 2024-04-22 12:24:43 +00:00
fyrchik merged commit 4a330a5706 into master 2024-04-22 15:01:22 +00:00
fyrchik deleted branch unify-json-handling 2024-04-22 15:01:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-api-go#72
No description provided.