diff --git a/session/container.go b/session/container.go index cb2f86bd..ec824857 100644 --- a/session/container.go +++ b/session/container.go @@ -115,12 +115,8 @@ func (x *ContainerContext) IsForSetEACL() bool { } // Marshal marshals ContainerContext into a protobuf binary form. -func (x *ContainerContext) Marshal(bs ...[]byte) ([]byte, error) { - var buf []byte - if len(bs) > 0 { - buf = bs[0] - } - return x.ToV2().StableMarshal(buf) +func (x *ContainerContext) Marshal() ([]byte, error) { + return x.ToV2().StableMarshal(nil) } // Unmarshal unmarshals protobuf binary representation of ContainerContext. diff --git a/session/session.go b/session/session.go index 623586d9..c38e0d76 100644 --- a/session/session.go +++ b/session/session.go @@ -250,17 +250,9 @@ func GetContainerContext(t *Token) *ContainerContext { } // Marshal marshals Token into a protobuf binary form. -// -// Buffer is allocated when the argument is empty. -// Otherwise, the first buffer is used. -func (t *Token) Marshal(bs ...[]byte) ([]byte, error) { - var buf []byte - if len(bs) > 0 { - buf = bs[0] - } - +func (t *Token) Marshal() ([]byte, error) { return (*session.SessionToken)(t). - StableMarshal(buf) + StableMarshal(nil) } // Unmarshal unmarshals protobuf binary representation of Token.