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

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
support/v0.27
Leonard Lyubich 2020-09-22 17:54:43 +03:00 committed by Alex Vanin
parent becb9148c1
commit 2f57855775
1 changed files with 13 additions and 0 deletions

View File

@ -57,3 +57,16 @@ func (o *RawObject) Object() *Object {
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
}