[#108] protogen: Distinguish between empty and nil messages

Refs #59

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-08-27 10:53:43 +03:00
parent 11e194d274
commit 5fece80b42
18 changed files with 282 additions and 283 deletions

View file

@ -50,7 +50,7 @@ func (x *BalanceRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -205,13 +205,13 @@ func (x *BalanceRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -404,7 +404,7 @@ func (x *BalanceResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Balance != nil && x.Balance.StableSize() != 0 {
if x.Balance != nil {
x.Balance.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -559,13 +559,13 @@ func (x *BalanceResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -708,12 +708,12 @@ func (x *EACLRecord) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendInt32(2, int32(x.Action))
}
for i := range x.Filters {
if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 {
if x.Filters[i] != nil {
x.Filters[i].EmitProtobuf(mm.AppendMessage(3))
}
}
for i := range x.Targets {
if x.Targets[i] != nil && x.Targets[i].StableSize() != 0 {
if x.Targets[i] != nil {
x.Targets[i].EmitProtobuf(mm.AppendMessage(4))
}
}
@ -997,14 +997,14 @@ func (x *EACLTable) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Version != nil && x.Version.StableSize() != 0 {
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(2))
}
for i := range x.Records {
if x.Records[i] != nil && x.Records[i].StableSize() != 0 {
if x.Records[i] != nil {
x.Records[i].EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1408,11 +1408,11 @@ func (x *BearerToken_Body_APEOverride) EmitProtobuf(mm *easyproto.MessageMarshal
if x == nil {
return
}
if x.Target != nil && x.Target.StableSize() != 0 {
if x.Target != nil {
x.Target.EmitProtobuf(mm.AppendMessage(1))
}
for i := range x.Chains {
if x.Chains[i] != nil && x.Chains[i].StableSize() != 0 {
if x.Chains[i] != nil {
x.Chains[i].EmitProtobuf(mm.AppendMessage(2))
}
}
@ -1599,19 +1599,19 @@ func (x *BearerToken_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.EaclTable != nil && x.EaclTable.StableSize() != 0 {
if x.EaclTable != nil {
x.EaclTable.EmitProtobuf(mm.AppendMessage(1))
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(2))
}
if x.Lifetime != nil && x.Lifetime.StableSize() != 0 {
if x.Lifetime != nil {
x.Lifetime.EmitProtobuf(mm.AppendMessage(3))
}
if x.AllowImpersonate {
mm.AppendBool(4, x.AllowImpersonate)
}
if x.ApeOverride != nil && x.ApeOverride.StableSize() != 0 {
if x.ApeOverride != nil {
x.ApeOverride.EmitProtobuf(mm.AppendMessage(5))
}
}
@ -1862,10 +1862,10 @@ func (x *BearerToken) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
}

View file

@ -52,10 +52,10 @@ func (x *AddChainRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Target != nil && x.Target.StableSize() != 0 {
if x.Target != nil {
x.Target.EmitProtobuf(mm.AppendMessage(1))
}
if x.Chain != nil && x.Chain.StableSize() != 0 {
if x.Chain != nil {
x.Chain.EmitProtobuf(mm.AppendMessage(2))
}
}
@ -240,13 +240,13 @@ func (x *AddChainRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -590,13 +590,13 @@ func (x *AddChainResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -791,7 +791,7 @@ func (x *RemoveChainRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Target != nil && x.Target.StableSize() != 0 {
if x.Target != nil {
x.Target.EmitProtobuf(mm.AppendMessage(1))
}
if len(x.ChainId) != 0 {
@ -975,13 +975,13 @@ func (x *RemoveChainRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1291,13 +1291,13 @@ func (x *RemoveChainResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1490,7 +1490,7 @@ func (x *ListChainsRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Target != nil && x.Target.StableSize() != 0 {
if x.Target != nil {
x.Target.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -1645,13 +1645,13 @@ func (x *ListChainsRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1847,7 +1847,7 @@ func (x *ListChainsResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
for i := range x.Chains {
if x.Chains[i] != nil && x.Chains[i].StableSize() != 0 {
if x.Chains[i] != nil {
x.Chains[i].EmitProtobuf(mm.AppendMessage(1))
}
}
@ -2018,13 +2018,13 @@ func (x *ListChainsResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -53,10 +53,10 @@ func (x *PutRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Container != nil && x.Container.StableSize() != 0 {
if x.Container != nil {
x.Container.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
}
@ -241,13 +241,13 @@ func (x *PutRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -440,7 +440,7 @@ func (x *PutResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -595,13 +595,13 @@ func (x *PutResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -796,10 +796,10 @@ func (x *DeleteRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
}
@ -984,13 +984,13 @@ func (x *DeleteRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1300,13 +1300,13 @@ func (x *DeleteResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1499,7 +1499,7 @@ func (x *GetRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -1654,13 +1654,13 @@ func (x *GetRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1857,13 +1857,13 @@ func (x *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Container != nil && x.Container.StableSize() != 0 {
if x.Container != nil {
x.Container.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
if x.SessionToken != nil && x.SessionToken.StableSize() != 0 {
if x.SessionToken != nil {
x.SessionToken.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -2078,13 +2078,13 @@ func (x *GetResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -2277,7 +2277,7 @@ func (x *ListRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -2432,13 +2432,13 @@ func (x *ListRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -2634,7 +2634,7 @@ func (x *ListResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
for i := range x.ContainerIds {
if x.ContainerIds[i] != nil && x.ContainerIds[i].StableSize() != 0 {
if x.ContainerIds[i] != nil {
x.ContainerIds[i].EmitProtobuf(mm.AppendMessage(1))
}
}
@ -2805,13 +2805,13 @@ func (x *ListResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -3004,7 +3004,7 @@ func (x *GetExtendedACLRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler
if x == nil {
return
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -3159,13 +3159,13 @@ func (x *GetExtendedACLRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -3362,13 +3362,13 @@ func (x *GetExtendedACLResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshale
if x == nil {
return
}
if x.Eacl != nil && x.Eacl.StableSize() != 0 {
if x.Eacl != nil {
x.Eacl.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
if x.SessionToken != nil && x.SessionToken.StableSize() != 0 {
if x.SessionToken != nil {
x.SessionToken.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -3583,13 +3583,13 @@ func (x *GetExtendedACLResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -222,10 +222,10 @@ func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Version != nil && x.Version.StableSize() != 0 {
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(2))
}
if len(x.Nonce) != 0 {
@ -235,11 +235,11 @@ func (x *Container) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendUint32(4, x.BasicAcl)
}
for i := range x.Attributes {
if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 {
if x.Attributes[i] != nil {
x.Attributes[i].EmitProtobuf(mm.AppendMessage(5))
}
}
if x.PlacementPolicy != nil && x.PlacementPolicy.StableSize() != 0 {
if x.PlacementPolicy != nil {
x.PlacementPolicy.EmitProtobuf(mm.AppendMessage(6))
}
}

View file

@ -52,7 +52,7 @@ func (x *Lock) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
for i := range x.Members {
if x.Members[i] != nil && x.Members[i].StableSize() != 0 {
if x.Members[i] != nil {
x.Members[i].EmitProtobuf(mm.AppendMessage(1))
}
}

View file

@ -167,13 +167,13 @@ func (x *LocalNodeInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -368,10 +368,10 @@ func (x *LocalNodeInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler
if x == nil {
return
}
if x.Version != nil && x.Version.StableSize() != 0 {
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.NodeInfo != nil && x.NodeInfo.StableSize() != 0 {
if x.NodeInfo != nil {
x.NodeInfo.EmitProtobuf(mm.AppendMessage(2))
}
}
@ -556,13 +556,13 @@ func (x *LocalNodeInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -872,13 +872,13 @@ func (x *NetworkInfoRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1071,7 +1071,7 @@ func (x *NetworkInfoResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler)
if x == nil {
return
}
if x.NetworkInfo != nil && x.NetworkInfo.StableSize() != 0 {
if x.NetworkInfo != nil {
x.NetworkInfo.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -1226,13 +1226,13 @@ func (x *NetworkInfoResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1542,13 +1542,13 @@ func (x *NetmapSnapshotRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1741,7 +1741,7 @@ func (x *NetmapSnapshotResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshale
if x == nil {
return
}
if x.Netmap != nil && x.Netmap.StableSize() != 0 {
if x.Netmap != nil {
x.Netmap.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -1896,13 +1896,13 @@ func (x *NetmapSnapshotResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -166,7 +166,7 @@ func (x *Filter) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendString(4, x.Value)
}
for i := range x.Filters {
if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 {
if x.Filters[i] != nil {
x.Filters[i].EmitProtobuf(mm.AppendMessage(5))
}
}
@ -941,7 +941,7 @@ func (x *PlacementPolicy) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
for i := range x.Replicas {
if x.Replicas[i] != nil && x.Replicas[i].StableSize() != 0 {
if x.Replicas[i] != nil {
x.Replicas[i].EmitProtobuf(mm.AppendMessage(1))
}
}
@ -949,12 +949,12 @@ func (x *PlacementPolicy) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendUint32(2, x.ContainerBackupFactor)
}
for i := range x.Selectors {
if x.Selectors[i] != nil && x.Selectors[i].StableSize() != 0 {
if x.Selectors[i] != nil {
x.Selectors[i].EmitProtobuf(mm.AppendMessage(3))
}
}
for i := range x.Filters {
if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 {
if x.Filters[i] != nil {
x.Filters[i].EmitProtobuf(mm.AppendMessage(4))
}
}
@ -1506,7 +1506,7 @@ func (x *NodeInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendString(2, x.Addresses[j])
}
for i := range x.Attributes {
if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 {
if x.Attributes[i] != nil {
x.Attributes[i].EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1774,7 +1774,7 @@ func (x *Netmap) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendUint64(1, x.Epoch)
}
for i := range x.Nodes {
if x.Nodes[i] != nil && x.Nodes[i].StableSize() != 0 {
if x.Nodes[i] != nil {
x.Nodes[i].EmitProtobuf(mm.AppendMessage(2))
}
}
@ -2112,7 +2112,7 @@ func (x *NetworkConfig) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
for i := range x.Parameters {
if x.Parameters[i] != nil && x.Parameters[i].StableSize() != 0 {
if x.Parameters[i] != nil {
x.Parameters[i].EmitProtobuf(mm.AppendMessage(1))
}
}
@ -2276,7 +2276,7 @@ func (x *NetworkInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x.MsPerBlock != 0 {
mm.AppendInt64(3, x.MsPerBlock)
}
if x.NetworkConfig != nil && x.NetworkConfig.StableSize() != 0 {
if x.NetworkConfig != nil {
x.NetworkConfig.EmitProtobuf(mm.AppendMessage(4))
}
}

View file

@ -53,7 +53,7 @@ func (x *GetRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Address != nil && x.Address.StableSize() != 0 {
if x.Address != nil {
x.Address.EmitProtobuf(mm.AppendMessage(1))
}
if x.Raw {
@ -237,13 +237,13 @@ func (x *GetRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -440,13 +440,13 @@ func (x *GetResponse_Body_Init) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ObjectId != nil && x.ObjectId.StableSize() != 0 {
if x.ObjectId != nil {
x.ObjectId.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
if x.Header != nil && x.Header.StableSize() != 0 {
if x.Header != nil {
x.Header.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -651,7 +651,7 @@ func (x *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
if inner, ok := x.ObjectPart.(*GetResponse_Body_Init_); ok {
if inner.Init != nil && inner.Init.StableSize() != 0 {
if inner.Init != nil {
inner.Init.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -661,12 +661,12 @@ func (x *GetResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
}
}
if inner, ok := x.ObjectPart.(*GetResponse_Body_SplitInfo); ok {
if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 {
if inner.SplitInfo != nil {
inner.SplitInfo.EmitProtobuf(mm.AppendMessage(3))
}
}
if inner, ok := x.ObjectPart.(*GetResponse_Body_EcInfo); ok {
if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 {
if inner.EcInfo != nil {
inner.EcInfo.EmitProtobuf(mm.AppendMessage(4))
}
}
@ -971,13 +971,13 @@ func (x *GetResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1178,13 +1178,13 @@ func (x *PutRequest_Body_Init) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ObjectId != nil && x.ObjectId.StableSize() != 0 {
if x.ObjectId != nil {
x.ObjectId.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
if x.Header != nil && x.Header.StableSize() != 0 {
if x.Header != nil {
x.Header.EmitProtobuf(mm.AppendMessage(3))
}
if len(x.CopiesNumber) != 0 {
@ -1426,7 +1426,7 @@ func (x *PutRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
if inner, ok := x.ObjectPart.(*PutRequest_Body_Init_); ok {
if inner.Init != nil && inner.Init.StableSize() != 0 {
if inner.Init != nil {
inner.Init.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -1656,13 +1656,13 @@ func (x *PutRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -1855,7 +1855,7 @@ func (x *PutResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ObjectId != nil && x.ObjectId.StableSize() != 0 {
if x.ObjectId != nil {
x.ObjectId.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -2010,13 +2010,13 @@ func (x *PutResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -2209,7 +2209,7 @@ func (x *DeleteRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Address != nil && x.Address.StableSize() != 0 {
if x.Address != nil {
x.Address.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -2364,13 +2364,13 @@ func (x *DeleteRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -2563,7 +2563,7 @@ func (x *DeleteResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Tombstone != nil && x.Tombstone.StableSize() != 0 {
if x.Tombstone != nil {
x.Tombstone.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -2718,13 +2718,13 @@ func (x *DeleteResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -2921,7 +2921,7 @@ func (x *HeadRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Address != nil && x.Address.StableSize() != 0 {
if x.Address != nil {
x.Address.EmitProtobuf(mm.AppendMessage(1))
}
if x.MainOnly {
@ -3134,13 +3134,13 @@ func (x *HeadRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -3335,10 +3335,10 @@ func (x *HeaderWithSignature) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Header != nil && x.Header.StableSize() != 0 {
if x.Header != nil {
x.Header.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
}
@ -3513,22 +3513,22 @@ func (x *HeadResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
if inner, ok := x.Head.(*HeadResponse_Body_Header); ok {
if inner.Header != nil && inner.Header.StableSize() != 0 {
if inner.Header != nil {
inner.Header.EmitProtobuf(mm.AppendMessage(1))
}
}
if inner, ok := x.Head.(*HeadResponse_Body_ShortHeader); ok {
if inner.ShortHeader != nil && inner.ShortHeader.StableSize() != 0 {
if inner.ShortHeader != nil {
inner.ShortHeader.EmitProtobuf(mm.AppendMessage(2))
}
}
if inner, ok := x.Head.(*HeadResponse_Body_SplitInfo); ok {
if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 {
if inner.SplitInfo != nil {
inner.SplitInfo.EmitProtobuf(mm.AppendMessage(3))
}
}
if inner, ok := x.Head.(*HeadResponse_Body_EcInfo); ok {
if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 {
if inner.EcInfo != nil {
inner.EcInfo.EmitProtobuf(mm.AppendMessage(4))
}
}
@ -3829,13 +3829,13 @@ func (x *HeadResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -4241,14 +4241,14 @@ func (x *SearchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(1))
}
if x.Version != 0 {
mm.AppendUint32(2, x.Version)
}
for i := range x.Filters {
if x.Filters[i] != nil && x.Filters[i].StableSize() != 0 {
if x.Filters[i] != nil {
x.Filters[i].EmitProtobuf(mm.AppendMessage(3))
}
}
@ -4475,13 +4475,13 @@ func (x *SearchRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -4677,7 +4677,7 @@ func (x *SearchResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
for i := range x.IdList {
if x.IdList[i] != nil && x.IdList[i].StableSize() != 0 {
if x.IdList[i] != nil {
x.IdList[i].EmitProtobuf(mm.AppendMessage(1))
}
}
@ -4848,13 +4848,13 @@ func (x *SearchResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -5211,10 +5211,10 @@ func (x *GetRangeRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Address != nil && x.Address.StableSize() != 0 {
if x.Address != nil {
x.Address.EmitProtobuf(mm.AppendMessage(1))
}
if x.Range != nil && x.Range.StableSize() != 0 {
if x.Range != nil {
x.Range.EmitProtobuf(mm.AppendMessage(2))
}
if x.Raw {
@ -5428,13 +5428,13 @@ func (x *GetRangeRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -5641,12 +5641,12 @@ func (x *GetRangeResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
}
}
if inner, ok := x.RangePart.(*GetRangeResponse_Body_SplitInfo); ok {
if inner.SplitInfo != nil && inner.SplitInfo.StableSize() != 0 {
if inner.SplitInfo != nil {
inner.SplitInfo.EmitProtobuf(mm.AppendMessage(2))
}
}
if inner, ok := x.RangePart.(*GetRangeResponse_Body_EcInfo); ok {
if inner.EcInfo != nil && inner.EcInfo.StableSize() != 0 {
if inner.EcInfo != nil {
inner.EcInfo.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -5911,13 +5911,13 @@ func (x *GetRangeResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -6118,11 +6118,11 @@ func (x *GetRangeHashRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler)
if x == nil {
return
}
if x.Address != nil && x.Address.StableSize() != 0 {
if x.Address != nil {
x.Address.EmitProtobuf(mm.AppendMessage(1))
}
for i := range x.Ranges {
if x.Ranges[i] != nil && x.Ranges[i].StableSize() != 0 {
if x.Ranges[i] != nil {
x.Ranges[i].EmitProtobuf(mm.AppendMessage(2))
}
}
@ -6397,13 +6397,13 @@ func (x *GetRangeHashRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -6808,13 +6808,13 @@ func (x *GetRangeHashResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -7011,7 +7011,7 @@ func (x *PutSingleRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Object != nil && x.Object.StableSize() != 0 {
if x.Object != nil {
x.Object.EmitProtobuf(mm.AppendMessage(1))
}
if len(x.CopiesNumber) != 0 {
@ -7209,13 +7209,13 @@ func (x *PutSingleRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -7525,13 +7525,13 @@ func (x *PutSingleResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -7726,7 +7726,7 @@ func (x *PatchRequest_Body_Patch) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.SourceRange != nil && x.SourceRange.StableSize() != 0 {
if x.SourceRange != nil {
x.SourceRange.EmitProtobuf(mm.AppendMessage(1))
}
if len(x.Chunk) != 0 {
@ -7896,18 +7896,18 @@ func (x *PatchRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Address != nil && x.Address.StableSize() != 0 {
if x.Address != nil {
x.Address.EmitProtobuf(mm.AppendMessage(1))
}
for i := range x.NewAttributes {
if x.NewAttributes[i] != nil && x.NewAttributes[i].StableSize() != 0 {
if x.NewAttributes[i] != nil {
x.NewAttributes[i].EmitProtobuf(mm.AppendMessage(2))
}
}
if x.ReplaceAttributes {
mm.AppendBool(3, x.ReplaceAttributes)
}
if x.Patch != nil && x.Patch.StableSize() != 0 {
if x.Patch != nil {
x.Patch.EmitProtobuf(mm.AppendMessage(4))
}
}
@ -8163,13 +8163,13 @@ func (x *PatchRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -8362,7 +8362,7 @@ func (x *PatchResponse_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ObjectId != nil && x.ObjectId.StableSize() != 0 {
if x.ObjectId != nil {
x.ObjectId.EmitProtobuf(mm.AppendMessage(1))
}
}
@ -8517,13 +8517,13 @@ func (x *PatchResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -139,13 +139,13 @@ func (x *ShortHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Version != nil && x.Version.StableSize() != 0 {
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.CreationEpoch != 0 {
mm.AppendUint64(2, x.CreationEpoch)
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(3))
}
if int32(x.ObjectType) != 0 {
@ -154,10 +154,10 @@ func (x *ShortHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x.PayloadLength != 0 {
mm.AppendUint64(5, x.PayloadLength)
}
if x.PayloadHash != nil && x.PayloadHash.StableSize() != 0 {
if x.PayloadHash != nil {
x.PayloadHash.EmitProtobuf(mm.AppendMessage(6))
}
if x.HomomorphicHash != nil && x.HomomorphicHash.StableSize() != 0 {
if x.HomomorphicHash != nil {
x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(7))
}
}
@ -646,20 +646,20 @@ func (x *Header_Split) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Parent != nil && x.Parent.StableSize() != 0 {
if x.Parent != nil {
x.Parent.EmitProtobuf(mm.AppendMessage(1))
}
if x.Previous != nil && x.Previous.StableSize() != 0 {
if x.Previous != nil {
x.Previous.EmitProtobuf(mm.AppendMessage(2))
}
if x.ParentSignature != nil && x.ParentSignature.StableSize() != 0 {
if x.ParentSignature != nil {
x.ParentSignature.EmitProtobuf(mm.AppendMessage(3))
}
if x.ParentHeader != nil && x.ParentHeader.StableSize() != 0 {
if x.ParentHeader != nil {
x.ParentHeader.EmitProtobuf(mm.AppendMessage(4))
}
for i := range x.Children {
if x.Children[i] != nil && x.Children[i].StableSize() != 0 {
if x.Children[i] != nil {
x.Children[i].EmitProtobuf(mm.AppendMessage(5))
}
}
@ -973,7 +973,7 @@ func (x *Header_EC) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Parent != nil && x.Parent.StableSize() != 0 {
if x.Parent != nil {
x.Parent.EmitProtobuf(mm.AppendMessage(1))
}
if x.Index != 0 {
@ -991,11 +991,11 @@ func (x *Header_EC) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if len(x.ParentSplitId) != 0 {
mm.AppendBytes(6, x.ParentSplitId)
}
if x.ParentSplitParentId != nil && x.ParentSplitParentId.StableSize() != 0 {
if x.ParentSplitParentId != nil {
x.ParentSplitParentId.EmitProtobuf(mm.AppendMessage(7))
}
for i := range x.ParentAttributes {
if x.ParentAttributes[i] != nil && x.ParentAttributes[i].StableSize() != 0 {
if x.ParentAttributes[i] != nil {
x.ParentAttributes[i].EmitProtobuf(mm.AppendMessage(8))
}
}
@ -1358,13 +1358,13 @@ func (x *Header) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Version != nil && x.Version.StableSize() != 0 {
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(2))
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(3))
}
if x.CreationEpoch != 0 {
@ -1373,27 +1373,27 @@ func (x *Header) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x.PayloadLength != 0 {
mm.AppendUint64(5, x.PayloadLength)
}
if x.PayloadHash != nil && x.PayloadHash.StableSize() != 0 {
if x.PayloadHash != nil {
x.PayloadHash.EmitProtobuf(mm.AppendMessage(6))
}
if int32(x.ObjectType) != 0 {
mm.AppendInt32(7, int32(x.ObjectType))
}
if x.HomomorphicHash != nil && x.HomomorphicHash.StableSize() != 0 {
if x.HomomorphicHash != nil {
x.HomomorphicHash.EmitProtobuf(mm.AppendMessage(8))
}
if x.SessionToken != nil && x.SessionToken.StableSize() != 0 {
if x.SessionToken != nil {
x.SessionToken.EmitProtobuf(mm.AppendMessage(9))
}
for i := range x.Attributes {
if x.Attributes[i] != nil && x.Attributes[i].StableSize() != 0 {
if x.Attributes[i] != nil {
x.Attributes[i].EmitProtobuf(mm.AppendMessage(10))
}
}
if x.Split != nil && x.Split.StableSize() != 0 {
if x.Split != nil {
x.Split.EmitProtobuf(mm.AppendMessage(11))
}
if x.Ec != nil && x.Ec.StableSize() != 0 {
if x.Ec != nil {
x.Ec.EmitProtobuf(mm.AppendMessage(12))
}
}
@ -1881,13 +1881,13 @@ func (x *Object) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ObjectId != nil && x.ObjectId.StableSize() != 0 {
if x.ObjectId != nil {
x.ObjectId.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
if x.Header != nil && x.Header.StableSize() != 0 {
if x.Header != nil {
x.Header.EmitProtobuf(mm.AppendMessage(3))
}
if len(x.Payload) != 0 {
@ -2116,10 +2116,10 @@ func (x *SplitInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if len(x.SplitId) != 0 {
mm.AppendBytes(1, x.SplitId)
}
if x.LastPart != nil && x.LastPart.StableSize() != 0 {
if x.LastPart != nil {
x.LastPart.EmitProtobuf(mm.AppendMessage(2))
}
if x.Link != nil && x.Link.StableSize() != 0 {
if x.Link != nil {
x.Link.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -2312,7 +2312,7 @@ func (x *ECInfo_Chunk) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Id != nil && x.Id.StableSize() != 0 {
if x.Id != nil {
x.Id.EmitProtobuf(mm.AppendMessage(1))
}
if x.Index != 0 {
@ -2506,7 +2506,7 @@ func (x *ECInfo) EmitProtobuf(mm *easyproto.MessageMarshaler) {
return
}
for i := range x.Chunks {
if x.Chunks[i] != nil && x.Chunks[i].StableSize() != 0 {
if x.Chunks[i] != nil {
x.Chunks[i].EmitProtobuf(mm.AppendMessage(1))
}
}

View file

@ -121,10 +121,10 @@ func (x *Address) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(1))
}
if x.ObjectId != nil && x.ObjectId.StableSize() != 0 {
if x.ObjectId != nil {
x.ObjectId.EmitProtobuf(mm.AppendMessage(2))
}
}

View file

@ -111,7 +111,6 @@ func testCompatibility(t *testing.T, msgGen func(empty bool) message.Message) {
}
}
t.Run("empty", func(t *testing.T) {
t.Skip()
msg := msgGen(true)
t.Run(fmt.Sprintf("Binary_%T", msg), func(t *testing.T) {
compareBinary(t, msg)

View file

@ -51,7 +51,7 @@ func (x *CreateRequest_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(1))
}
if x.Expiration != 0 {
@ -235,13 +235,13 @@ func (x *CreateRequest) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -616,13 +616,13 @@ func (x *CreateResponse) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaHeader != nil && x.MetaHeader.StableSize() != 0 {
if x.MetaHeader != nil {
x.MetaHeader.EmitProtobuf(mm.AppendMessage(2))
}
if x.VerifyHeader != nil && x.VerifyHeader.StableSize() != 0 {
if x.VerifyHeader != nil {
x.VerifyHeader.EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -109,11 +109,11 @@ func (x *ObjectSessionContext_Target) EmitProtobuf(mm *easyproto.MessageMarshale
if x == nil {
return
}
if x.Container != nil && x.Container.StableSize() != 0 {
if x.Container != nil {
x.Container.EmitProtobuf(mm.AppendMessage(1))
}
for i := range x.Objects {
if x.Objects[i] != nil && x.Objects[i].StableSize() != 0 {
if x.Objects[i] != nil {
x.Objects[i].EmitProtobuf(mm.AppendMessage(2))
}
}
@ -297,7 +297,7 @@ func (x *ObjectSessionContext) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if int32(x.Verb) != 0 {
mm.AppendInt32(1, int32(x.Verb))
}
if x.Target != nil && x.Target.StableSize() != 0 {
if x.Target != nil {
x.Target.EmitProtobuf(mm.AppendMessage(2))
}
}
@ -520,7 +520,7 @@ func (x *ContainerSessionContext) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x.Wildcard {
mm.AppendBool(2, x.Wildcard)
}
if x.ContainerId != nil && x.ContainerId.StableSize() != 0 {
if x.ContainerId != nil {
x.ContainerId.EmitProtobuf(mm.AppendMessage(3))
}
}
@ -928,22 +928,22 @@ func (x *SessionToken_Body) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if len(x.Id) != 0 {
mm.AppendBytes(1, x.Id)
}
if x.OwnerId != nil && x.OwnerId.StableSize() != 0 {
if x.OwnerId != nil {
x.OwnerId.EmitProtobuf(mm.AppendMessage(2))
}
if x.Lifetime != nil && x.Lifetime.StableSize() != 0 {
if x.Lifetime != nil {
x.Lifetime.EmitProtobuf(mm.AppendMessage(3))
}
if len(x.SessionKey) != 0 {
mm.AppendBytes(4, x.SessionKey)
}
if inner, ok := x.Context.(*SessionToken_Body_Object); ok {
if inner.Object != nil && inner.Object.StableSize() != 0 {
if inner.Object != nil {
inner.Object.EmitProtobuf(mm.AppendMessage(5))
}
}
if inner, ok := x.Context.(*SessionToken_Body_Container); ok {
if inner.Container != nil && inner.Container.StableSize() != 0 {
if inner.Container != nil {
inner.Container.EmitProtobuf(mm.AppendMessage(6))
}
}
@ -1256,10 +1256,10 @@ func (x *SessionToken) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Body != nil && x.Body.StableSize() != 0 {
if x.Body != nil {
x.Body.EmitProtobuf(mm.AppendMessage(1))
}
if x.Signature != nil && x.Signature.StableSize() != 0 {
if x.Signature != nil {
x.Signature.EmitProtobuf(mm.AppendMessage(2))
}
}
@ -1598,7 +1598,7 @@ func (x *RequestMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Version != nil && x.Version.StableSize() != 0 {
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.Epoch != 0 {
@ -1608,17 +1608,17 @@ func (x *RequestMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendUint32(3, x.Ttl)
}
for i := range x.XHeaders {
if x.XHeaders[i] != nil && x.XHeaders[i].StableSize() != 0 {
if x.XHeaders[i] != nil {
x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4))
}
}
if x.SessionToken != nil && x.SessionToken.StableSize() != 0 {
if x.SessionToken != nil {
x.SessionToken.EmitProtobuf(mm.AppendMessage(5))
}
if x.BearerToken != nil && x.BearerToken.StableSize() != 0 {
if x.BearerToken != nil {
x.BearerToken.EmitProtobuf(mm.AppendMessage(6))
}
if x.Origin != nil && x.Origin.StableSize() != 0 {
if x.Origin != nil {
x.Origin.EmitProtobuf(mm.AppendMessage(7))
}
if x.MagicNumber != 0 {
@ -1979,7 +1979,7 @@ func (x *ResponseMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) {
if x == nil {
return
}
if x.Version != nil && x.Version.StableSize() != 0 {
if x.Version != nil {
x.Version.EmitProtobuf(mm.AppendMessage(1))
}
if x.Epoch != 0 {
@ -1989,14 +1989,14 @@ func (x *ResponseMetaHeader) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendUint32(3, x.Ttl)
}
for i := range x.XHeaders {
if x.XHeaders[i] != nil && x.XHeaders[i].StableSize() != 0 {
if x.XHeaders[i] != nil {
x.XHeaders[i].EmitProtobuf(mm.AppendMessage(4))
}
}
if x.Origin != nil && x.Origin.StableSize() != 0 {
if x.Origin != nil {
x.Origin.EmitProtobuf(mm.AppendMessage(5))
}
if x.Status != nil && x.Status.StableSize() != 0 {
if x.Status != nil {
x.Status.EmitProtobuf(mm.AppendMessage(6))
}
}
@ -2292,16 +2292,16 @@ func (x *RequestVerificationHeader) EmitProtobuf(mm *easyproto.MessageMarshaler)
if x == nil {
return
}
if x.BodySignature != nil && x.BodySignature.StableSize() != 0 {
if x.BodySignature != nil {
x.BodySignature.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaSignature != nil && x.MetaSignature.StableSize() != 0 {
if x.MetaSignature != nil {
x.MetaSignature.EmitProtobuf(mm.AppendMessage(2))
}
if x.OriginSignature != nil && x.OriginSignature.StableSize() != 0 {
if x.OriginSignature != nil {
x.OriginSignature.EmitProtobuf(mm.AppendMessage(3))
}
if x.Origin != nil && x.Origin.StableSize() != 0 {
if x.Origin != nil {
x.Origin.EmitProtobuf(mm.AppendMessage(4))
}
}
@ -2530,16 +2530,16 @@ func (x *ResponseVerificationHeader) EmitProtobuf(mm *easyproto.MessageMarshaler
if x == nil {
return
}
if x.BodySignature != nil && x.BodySignature.StableSize() != 0 {
if x.BodySignature != nil {
x.BodySignature.EmitProtobuf(mm.AppendMessage(1))
}
if x.MetaSignature != nil && x.MetaSignature.StableSize() != 0 {
if x.MetaSignature != nil {
x.MetaSignature.EmitProtobuf(mm.AppendMessage(2))
}
if x.OriginSignature != nil && x.OriginSignature.StableSize() != 0 {
if x.OriginSignature != nil {
x.OriginSignature.EmitProtobuf(mm.AppendMessage(3))
}
if x.Origin != nil && x.Origin.StableSize() != 0 {
if x.Origin != nil {
x.Origin.EmitProtobuf(mm.AppendMessage(4))
}
}

View file

@ -476,7 +476,7 @@ func (x *Status) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendString(2, x.Message)
}
for i := range x.Details {
if x.Details[i] != nil && x.Details[i].StableSize() != 0 {
if x.Details[i] != nil {
x.Details[i].EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -62,7 +62,7 @@ func (x *Tombstone) EmitProtobuf(mm *easyproto.MessageMarshaler) {
mm.AppendBytes(2, x.SplitId)
}
for i := range x.Members {
if x.Members[i] != nil && x.Members[i].StableSize() != 0 {
if x.Members[i] != nil {
x.Members[i].EmitProtobuf(mm.AppendMessage(3))
}
}

View file

@ -288,7 +288,7 @@ func (x *Primitives) EmitProtobuf(mm *easyproto.MessageMarshaler) {
}
}
if inner, ok := x.FieldM.(*Primitives_FieldAux); ok {
if inner.FieldAux != nil && inner.FieldAux.StableSize() != 0 {
if inner.FieldAux != nil {
inner.FieldAux.EmitProtobuf(mm.AppendMessage(403))
}
}

View file

@ -174,7 +174,7 @@ func emitMarshalRaw(g *protogen.GeneratedFile, f *protogen.Field, name string) {
name += "[i]"
}
g.P("if ", notNil(name), " && ", name, ".StableSize() != 0 {")
g.P("if ", notNil(name), " {")
g.P(name, ".EmitProtobuf(mm.AppendMessage(", f.Desc.Number(), "))")
g.P("}")
return