From 14fa89b81919a978a4e86b79395718c79f4ca350 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 22 Sep 2020 15:10:01 +0300 Subject: [PATCH] [#155] sdk/object: Add Object to RawObject converter Signed-off-by: Leonard Lyubich --- pkg/object/raw.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/object/raw.go b/pkg/object/raw.go index 0ff3ca00..a6f3e9d8 100644 --- a/pkg/object/raw.go +++ b/pkg/object/raw.go @@ -22,6 +22,11 @@ func NewRawFromV2(oV2 *object.Object) *RawObject { } } +// NewRawFrom wraps Object instance to RawObject. +func NewRawFrom(obj *Object) *RawObject { + return NewRawFromV2(obj.ToV2()) +} + // NewRaw creates and initializes blank RawObject. // // Works similar as NewRawFromV2(new(Object)).