[#38] sdk/object: Add CutPayload method to RawObject

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-22 17:54:43 +03:00 committed by Alex Vanin
parent becb9148c1
commit 2f57855775

View file

@ -57,3 +57,16 @@ func (o *RawObject) Object() *Object {
return nil return nil
} }
// CutPayload returns RawObject w/ empty payload.
//
// Changes of non-payload fields affect source object.
func (o *RawObject) CutPayload() *RawObject {
if o != nil {
return &RawObject{
RawObject: o.RawObject.CutPayload(),
}
}
return nil
}