From 732dd51b1b38d1675396a68169777eb9f5e0ee84 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 23 Mar 2022 14:42:57 +0300 Subject: [PATCH] [#388] *: Remove nil check from setters I knew one day `sed` would save me an hour of manual work: ``` sed -i -n -e ' s/) Set/) Set/ p t setter b end :setter n s/nil/nil/ t hasif p b end :hasif n :loop p n s/}/}/ t end b loop :end ' $@ goimports -w $@ ``` Signed-off-by: Evgenii Stratonikov --- accounting/accounting.go | 24 +-- accounting/grpc/service.go | 32 +--- accounting/grpc/types.go | 8 +- acl/grpc/types.go | 84 +++------ acl/types.go | 84 +++------ audit/grpc/types.go | 56 ++---- audit/types.go | 56 ++---- container/grpc/service.go | 248 ++++++------------------ container/grpc/types.go | 32 +--- container/types.go | 192 ++++++------------- netmap/grpc/service.go | 60 ++---- netmap/grpc/types.go | 124 +++--------- netmap/types.go | 144 ++++---------- object/grpc/service.go | 374 ++++++++++--------------------------- object/grpc/types.go | 132 ++++--------- object/types.go | 356 +++++++++-------------------------- refs/grpc/types.go | 60 ++---- refs/types.go | 52 ++---- reputation/grpc/service.go | 68 ++----- reputation/grpc/types.go | 40 +--- reputation/types.go | 76 ++------ session/grpc/service.go | 40 +--- session/grpc/types.go | 164 +++++----------- session/types.go | 196 +++++-------------- session/util.go | 16 +- status/grpc/types.go | 20 +- status/types.go | 16 +- storagegroup/grpc/types.go | 16 +- storagegroup/types.go | 16 +- subnet/grpc/types.go | 8 +- tombstone/grpc/types.go | 12 +- tombstone/types.go | 12 +- 32 files changed, 714 insertions(+), 2104 deletions(-) diff --git a/accounting/accounting.go b/accounting/accounting.go index d2d287f..5277b1d 100644 --- a/accounting/accounting.go +++ b/accounting/accounting.go @@ -40,9 +40,7 @@ func (b *BalanceRequestBody) GetOwnerID() *refs.OwnerID { } func (b *BalanceRequestBody) SetOwnerID(v *refs.OwnerID) { - if b != nil { - b.ownerID = v - } + b.ownerID = v } func (b *BalanceRequest) GetBody() *BalanceRequestBody { @@ -54,9 +52,7 @@ func (b *BalanceRequest) GetBody() *BalanceRequestBody { } func (b *BalanceRequest) SetBody(v *BalanceRequestBody) { - if b != nil { - b.body = v - } + b.body = v } func (d *Decimal) GetValue() int64 { @@ -68,9 +64,7 @@ func (d *Decimal) GetValue() int64 { } func (d *Decimal) SetValue(v int64) { - if d != nil { - d.val = v - } + d.val = v } func (d *Decimal) GetPrecision() uint32 { @@ -82,9 +76,7 @@ func (d *Decimal) GetPrecision() uint32 { } func (d *Decimal) SetPrecision(v uint32) { - if d != nil { - d.prec = v - } + d.prec = v } func (br *BalanceResponseBody) GetBalance() *Decimal { @@ -96,9 +88,7 @@ func (br *BalanceResponseBody) GetBalance() *Decimal { } func (br *BalanceResponseBody) SetBalance(v *Decimal) { - if br != nil { - br.bal = v - } + br.bal = v } func (br *BalanceResponse) GetBody() *BalanceResponseBody { @@ -110,7 +100,5 @@ func (br *BalanceResponse) GetBody() *BalanceResponseBody { } func (br *BalanceResponse) SetBody(v *BalanceResponseBody) { - if br != nil { - br.body = v - } + br.body = v } diff --git a/accounting/grpc/service.go b/accounting/grpc/service.go index 78adedb..91f9713 100644 --- a/accounting/grpc/service.go +++ b/accounting/grpc/service.go @@ -7,56 +7,40 @@ import ( // SetOwnerId sets identifier of the account owner. func (m *BalanceRequest_Body) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetBody sets body of the request. func (m *BalanceRequest) SetBody(v *BalanceRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *BalanceRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *BalanceRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetBalance sets balance value of the response. func (m *BalanceResponse_Body) SetBalance(v *Decimal) { - if m != nil { - m.Balance = v - } + m.Balance = v } // SetBody sets body of the response. func (m *BalanceResponse) SetBody(v *BalanceResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *BalanceResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *BalanceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } diff --git a/accounting/grpc/types.go b/accounting/grpc/types.go index 3099f69..1c1bac9 100644 --- a/accounting/grpc/types.go +++ b/accounting/grpc/types.go @@ -2,14 +2,10 @@ package accounting // SetValue sets value of the decimal number. func (m *Decimal) SetValue(v int64) { - if m != nil { - m.Value = v - } + m.Value = v } // SetPrecision sets precision of the decimal number. func (m *Decimal) SetPrecision(v uint32) { - if m != nil { - m.Precision = v - } + m.Precision = v } diff --git a/acl/grpc/types.go b/acl/grpc/types.go index cc9b48b..032f5c9 100644 --- a/acl/grpc/types.go +++ b/acl/grpc/types.go @@ -6,149 +6,107 @@ import ( // SetVersion sets version of EACL rules in table. func (m *EACLTable) SetVersion(v *refs.Version) { - if m != nil { - m.Version = v - } + m.Version = v } // SetContainerId sets container identifier of the eACL table. func (m *EACLTable) SetContainerId(v *refs.ContainerID) { - if m != nil { - m.ContainerId = v - } + m.ContainerId = v } // SetRecords sets record list of the eACL table. func (m *EACLTable) SetRecords(v []*EACLRecord) { - if m != nil { - m.Records = v - } + m.Records = v } // SetOperation sets operation of the eACL record. func (m *EACLRecord) SetOperation(v Operation) { - if m != nil { - m.Operation = v - } + m.Operation = v } // SetAction sets action of the eACL record. func (m *EACLRecord) SetAction(v Action) { - if m != nil { - m.Action = v - } + m.Action = v } // SetFilters sets filter list of the eACL record. func (m *EACLRecord) SetFilters(v []*EACLRecord_Filter) { - if m != nil { - m.Filters = v - } + m.Filters = v } // SetTargets sets target list of the eACL record. func (m *EACLRecord) SetTargets(v []*EACLRecord_Target) { - if m != nil { - m.Targets = v - } + m.Targets = v } // SetHeader sets header type of the eACL filter. func (m *EACLRecord_Filter) SetHeader(v HeaderType) { - if m != nil { - m.HeaderType = v - } + m.HeaderType = v } // SetMatchType sets match type of the eACL filter. func (m *EACLRecord_Filter) SetMatchType(v MatchType) { - if m != nil { - m.MatchType = v - } + m.MatchType = v } // SetKey sets key of the eACL filter. func (m *EACLRecord_Filter) SetKey(v string) { - if m != nil { - m.Key = v - } + m.Key = v } // SetValue sets value of the eACL filter. func (m *EACLRecord_Filter) SetValue(v string) { - if m != nil { - m.Value = v - } + m.Value = v } // SetRole sets target group of the eACL target. func (m *EACLRecord_Target) SetRole(v Role) { - if m != nil { - m.Role = v - } + m.Role = v } // SetKeys of the eACL target. func (m *EACLRecord_Target) SetKeys(v [][]byte) { - if m != nil { - m.Keys = v - } + m.Keys = v } // SetEaclTable sets eACL table of the bearer token. func (m *BearerToken_Body) SetEaclTable(v *EACLTable) { - if m != nil { - m.EaclTable = v - } + m.EaclTable = v } // SetOwnerId sets identifier of the bearer token owner. func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetLifetime sets lifetime of the bearer token. func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { - if m != nil { - m.Lifetime = v - } + m.Lifetime = v } // SetBody sets bearer token body. func (m *BearerToken) SetBody(v *BearerToken_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetSignature sets bearer token signature. func (m *BearerToken) SetSignature(v *refs.Signature) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetExp sets epoch number of the token expiration. func (m *BearerToken_Body_TokenLifetime) SetExp(v uint64) { - if m != nil { - m.Exp = v - } + m.Exp = v } // SetNbf sets starting epoch number of the token. func (m *BearerToken_Body_TokenLifetime) SetNbf(v uint64) { - if m != nil { - m.Nbf = v - } + m.Nbf = v } // SetIat sets the number of the epoch in which the token was issued. func (m *BearerToken_Body_TokenLifetime) SetIat(v uint64) { - if m != nil { - m.Iat = v - } + m.Iat = v } // FromString parses Action from a string representation, diff --git a/acl/types.go b/acl/types.go index 70994b4..23c994c 100644 --- a/acl/types.go +++ b/acl/types.go @@ -121,9 +121,7 @@ func (f *HeaderFilter) GetHeaderType() HeaderType { } func (f *HeaderFilter) SetHeaderType(v HeaderType) { - if f != nil { - f.hdrType = v - } + f.hdrType = v } func (f *HeaderFilter) GetMatchType() MatchType { @@ -135,9 +133,7 @@ func (f *HeaderFilter) GetMatchType() MatchType { } func (f *HeaderFilter) SetMatchType(v MatchType) { - if f != nil { - f.matchType = v - } + f.matchType = v } func (f *HeaderFilter) GetKey() string { @@ -149,9 +145,7 @@ func (f *HeaderFilter) GetKey() string { } func (f *HeaderFilter) SetKey(v string) { - if f != nil { - f.key = v - } + f.key = v } func (f *HeaderFilter) GetValue() string { @@ -163,9 +157,7 @@ func (f *HeaderFilter) GetValue() string { } func (f *HeaderFilter) SetValue(v string) { - if f != nil { - f.value = v - } + f.value = v } func (t *Target) GetRole() Role { @@ -177,9 +169,7 @@ func (t *Target) GetRole() Role { } func (t *Target) SetRole(v Role) { - if t != nil { - t.role = v - } + t.role = v } func (t *Target) GetKeys() [][]byte { @@ -191,9 +181,7 @@ func (t *Target) GetKeys() [][]byte { } func (t *Target) SetKeys(v [][]byte) { - if t != nil { - t.keys = v - } + t.keys = v } func (r *Record) GetOperation() Operation { @@ -205,9 +193,7 @@ func (r *Record) GetOperation() Operation { } func (r *Record) SetOperation(v Operation) { - if r != nil { - r.op = v - } + r.op = v } func (r *Record) GetAction() Action { @@ -219,9 +205,7 @@ func (r *Record) GetAction() Action { } func (r *Record) SetAction(v Action) { - if r != nil { - r.action = v - } + r.action = v } func (r *Record) GetFilters() []HeaderFilter { @@ -233,9 +217,7 @@ func (r *Record) GetFilters() []HeaderFilter { } func (r *Record) SetFilters(v []HeaderFilter) { - if r != nil { - r.filters = v - } + r.filters = v } func (r *Record) GetTargets() []Target { @@ -247,9 +229,7 @@ func (r *Record) GetTargets() []Target { } func (r *Record) SetTargets(v []Target) { - if r != nil { - r.targets = v - } + r.targets = v } func (t *Table) GetVersion() *refs.Version { @@ -261,9 +241,7 @@ func (t *Table) GetVersion() *refs.Version { } func (t *Table) SetVersion(v *refs.Version) { - if t != nil { - t.version = v - } + t.version = v } func (t *Table) GetContainerID() *refs.ContainerID { @@ -275,9 +253,7 @@ func (t *Table) GetContainerID() *refs.ContainerID { } func (t *Table) SetContainerID(v *refs.ContainerID) { - if t != nil { - t.cid = v - } + t.cid = v } func (t *Table) GetRecords() []Record { @@ -289,9 +265,7 @@ func (t *Table) GetRecords() []Record { } func (t *Table) SetRecords(v []Record) { - if t != nil { - t.records = v - } + t.records = v } func (l *TokenLifetime) GetExp() uint64 { @@ -303,9 +277,7 @@ func (l *TokenLifetime) GetExp() uint64 { } func (l *TokenLifetime) SetExp(v uint64) { - if l != nil { - l.exp = v - } + l.exp = v } func (l *TokenLifetime) GetNbf() uint64 { @@ -317,9 +289,7 @@ func (l *TokenLifetime) GetNbf() uint64 { } func (l *TokenLifetime) SetNbf(v uint64) { - if l != nil { - l.nbf = v - } + l.nbf = v } func (l *TokenLifetime) GetIat() uint64 { @@ -331,9 +301,7 @@ func (l *TokenLifetime) GetIat() uint64 { } func (l *TokenLifetime) SetIat(v uint64) { - if l != nil { - l.iat = v - } + l.iat = v } func (bt *BearerTokenBody) GetEACL() *Table { @@ -345,9 +313,7 @@ func (bt *BearerTokenBody) GetEACL() *Table { } func (bt *BearerTokenBody) SetEACL(v *Table) { - if bt != nil { - bt.eacl = v - } + bt.eacl = v } func (bt *BearerTokenBody) GetOwnerID() *refs.OwnerID { @@ -359,9 +325,7 @@ func (bt *BearerTokenBody) GetOwnerID() *refs.OwnerID { } func (bt *BearerTokenBody) SetOwnerID(v *refs.OwnerID) { - if bt != nil { - bt.ownerID = v - } + bt.ownerID = v } func (bt *BearerTokenBody) GetLifetime() *TokenLifetime { @@ -373,9 +337,7 @@ func (bt *BearerTokenBody) GetLifetime() *TokenLifetime { } func (bt *BearerTokenBody) SetLifetime(v *TokenLifetime) { - if bt != nil { - bt.lifetime = v - } + bt.lifetime = v } func (bt *BearerToken) GetBody() *BearerTokenBody { @@ -387,9 +349,7 @@ func (bt *BearerToken) GetBody() *BearerTokenBody { } func (bt *BearerToken) SetBody(v *BearerTokenBody) { - if bt != nil { - bt.body = v - } + bt.body = v } func (bt *BearerToken) GetSignature() *refs.Signature { @@ -401,7 +361,5 @@ func (bt *BearerToken) GetSignature() *refs.Signature { } func (bt *BearerToken) SetSignature(v *refs.Signature) { - if bt != nil { - bt.sig = v - } + bt.sig = v } diff --git a/audit/grpc/types.go b/audit/grpc/types.go index d8dd0d1..36a2267 100644 --- a/audit/grpc/types.go +++ b/audit/grpc/types.go @@ -6,98 +6,70 @@ import ( // SetVersion is a Version field setter. func (x *DataAuditResult) SetVersion(v *refs.Version) { - if x != nil { - x.Version = v - } + x.Version = v } // SetAuditEpoch is an AuditEpoch field setter. func (x *DataAuditResult) SetAuditEpoch(v uint64) { - if x != nil { - x.AuditEpoch = v - } + x.AuditEpoch = v } // SetContainerId is a ContainerId field setter. func (x *DataAuditResult) SetContainerId(v *refs.ContainerID) { - if x != nil { - x.ContainerId = v - } + x.ContainerId = v } // SetPublicKey is a PublicKey field setter. func (x *DataAuditResult) SetPublicKey(v []byte) { - if x != nil { - x.PublicKey = v - } + x.PublicKey = v } // SetComplete is a Complete field setter. func (x *DataAuditResult) SetComplete(v bool) { - if x != nil { - x.Complete = v - } + x.Complete = v } // SetRequests is a Requests field setter. func (x *DataAuditResult) SetRequests(v uint32) { - if x != nil { - x.Requests = v - } + x.Requests = v } // SetRetries is a Retries field setter. func (x *DataAuditResult) SetRetries(v uint32) { - if x != nil { - x.Retries = v - } + x.Retries = v } // SetPassSg is a PassSg field setter. func (x *DataAuditResult) SetPassSg(v []*refs.ObjectID) { - if x != nil { - x.PassSg = v - } + x.PassSg = v } // SetFailSg is a FailSg field setter. func (x *DataAuditResult) SetFailSg(v []*refs.ObjectID) { - if x != nil { - x.FailSg = v - } + x.FailSg = v } // SetHit is a Hit field setter. func (x *DataAuditResult) SetHit(v uint32) { - if x != nil { - x.Hit = v - } + x.Hit = v } // SetMiss is a Miss field setter. func (x *DataAuditResult) SetMiss(v uint32) { - if x != nil { - x.Miss = v - } + x.Miss = v } // SetFail is a Fail field setter. func (x *DataAuditResult) SetFail(v uint32) { - if x != nil { - x.Fail = v - } + x.Fail = v } // SetPassNodes is a PassNodes field setter. func (x *DataAuditResult) SetPassNodes(v [][]byte) { - if x != nil { - x.PassNodes = v - } + x.PassNodes = v } // SetFailNodes is a FailNodes field setter. func (x *DataAuditResult) SetFailNodes(v [][]byte) { - if x != nil { - x.FailNodes = v - } + x.FailNodes = v } diff --git a/audit/types.go b/audit/types.go index 8245b2a..354ef47 100644 --- a/audit/types.go +++ b/audit/types.go @@ -37,9 +37,7 @@ func (a *DataAuditResult) GetVersion() *refs.Version { // SetVersion sets version of Data Audit structure. func (a *DataAuditResult) SetVersion(v *refs.Version) { - if a != nil { - a.version = v - } + a.version = v } // GetAuditEpoch returns epoch number when the Data Audit was conducted. @@ -53,9 +51,7 @@ func (a *DataAuditResult) GetAuditEpoch() uint64 { // SetAuditEpoch sets epoch number when the Data Audit was conducted. func (a *DataAuditResult) SetAuditEpoch(v uint64) { - if a != nil { - a.auditEpoch = v - } + a.auditEpoch = v } // GetContainerID returns container under audit. @@ -69,9 +65,7 @@ func (a *DataAuditResult) GetContainerID() *refs.ContainerID { // SetContainerID sets container under audit. func (a *DataAuditResult) SetContainerID(v *refs.ContainerID) { - if a != nil { - a.cid = v - } + a.cid = v } // GetPublicKey returns public key of the auditing InnerRing node in a binary format. @@ -85,9 +79,7 @@ func (a *DataAuditResult) GetPublicKey() []byte { // SetPublicKey sets public key of the auditing InnerRing node in a binary format. func (a *DataAuditResult) SetPublicKey(v []byte) { - if a != nil { - a.pubKey = v - } + a.pubKey = v } // GetPassSG returns list of Storage Groups that passed audit PoR stage. @@ -101,9 +93,7 @@ func (a *DataAuditResult) GetPassSG() []refs.ObjectID { // SetPassSG sets list of Storage Groups that passed audit PoR stage. func (a *DataAuditResult) SetPassSG(v []refs.ObjectID) { - if a != nil { - a.passSG = v - } + a.passSG = v } // GetFailSG returns list of Storage Groups that failed audit PoR stage. @@ -117,9 +107,7 @@ func (a *DataAuditResult) GetFailSG() []refs.ObjectID { // SetFailSG sets list of Storage Groups that failed audit PoR stage. func (a *DataAuditResult) SetFailSG(v []refs.ObjectID) { - if a != nil { - a.failSG = v - } + a.failSG = v } // GetRequests returns number of requests made by PoR audit check to get @@ -135,9 +123,7 @@ func (a *DataAuditResult) GetRequests() uint32 { // SetRequests sets number of requests made by PoR audit check to get // all headers of the objects inside storage groups. func (a *DataAuditResult) SetRequests(v uint32) { - if a != nil { - a.requests = v - } + a.requests = v } // GetRetries returns number of retries made by PoR audit check to get @@ -153,9 +139,7 @@ func (a *DataAuditResult) GetRetries() uint32 { // SetRetries sets number of retries made by PoR audit check to get // all headers of the objects inside storage groups. func (a *DataAuditResult) SetRetries(v uint32) { - if a != nil { - a.retries = v - } + a.retries = v } // GetHit returns number of sampled objects under audit placed @@ -173,9 +157,7 @@ func (a *DataAuditResult) GetHit() uint32 { // in an optimal way according to the containers placement policy // when checking PoP. func (a *DataAuditResult) SetHit(v uint32) { - if a != nil { - a.hit = v - } + a.hit = v } // GetMiss returns number of sampled objects under audit placed @@ -193,9 +175,7 @@ func (a *DataAuditResult) GetMiss() uint32 { // in suboptimal way according to the containers placement policy, // but still at a satisfactory level when checking PoP. func (a *DataAuditResult) SetMiss(v uint32) { - if a != nil { - a.miss = v - } + a.miss = v } // GetFail returns number of sampled objects under audit stored @@ -213,9 +193,7 @@ func (a *DataAuditResult) GetFail() uint32 { // in a way not confirming placement policy or not found at all // when checking PoP. func (a *DataAuditResult) SetFail(v uint32) { - if a != nil { - a.fail = v - } + a.fail = v } // GetPassNodes returns list of storage node public keys that @@ -231,9 +209,7 @@ func (a *DataAuditResult) GetPassNodes() [][]byte { // SetPassNodes sets list of storage node public keys that // passed at least one PDP. func (a *DataAuditResult) SetPassNodes(v [][]byte) { - if a != nil { - a.passNodes = v - } + a.passNodes = v } // GetFailNodes returns list of storage node public keys that @@ -249,9 +225,7 @@ func (a *DataAuditResult) GetFailNodes() [][]byte { // SetFailNodes sets list of storage node public keys that // failed at least one PDP. func (a *DataAuditResult) SetFailNodes(v [][]byte) { - if a != nil { - a.failNodes = v - } + a.failNodes = v } // GetComplete returns boolean completion statement of audit result. @@ -265,7 +239,5 @@ func (a *DataAuditResult) GetComplete() bool { // SetComplete sets boolean completion statement of audit result. func (a *DataAuditResult) SetComplete(v bool) { - if a != nil { - a.complete = v - } + a.complete = v } diff --git a/container/grpc/service.go b/container/grpc/service.go index 09743dc..e8f8e72 100644 --- a/container/grpc/service.go +++ b/container/grpc/service.go @@ -8,121 +8,87 @@ import ( // SetContainer sets container of the request. func (m *PutRequest_Body) SetContainer(v *Container) { - if m != nil { - m.Container = v - } + m.Container = v } // SetSignature sets signature of the container structure. func (m *PutRequest_Body) SetSignature(v *refs.SignatureRFC6979) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetBody sets body of the request. func (m *PutRequest) SetBody(v *PutRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetContainerId sets identifier of the container. func (m *PutResponse_Body) SetContainerId(v *refs.ContainerID) { - if m != nil { - m.ContainerId = v - } + m.ContainerId = v } // SetBody sets body of the response. func (m *PutResponse) SetBody(v *PutResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetContainerId sets identifier of the container. func (m *DeleteRequest_Body) SetContainerId(v *refs.ContainerID) { - if m != nil { - m.ContainerId = v - } + m.ContainerId = v } // SetSignature sets signature of the container identifier. func (m *DeleteRequest_Body) SetSignature(v *refs.SignatureRFC6979) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetBody sets body of the request. func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetBody sets body of the response. func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetContainerId sets identifier of the container. @@ -132,317 +98,227 @@ func (m *GetRequest_Body) SetContainerId(v *refs.ContainerID) { // SetBody sets body of the request. func (m *GetRequest) SetBody(v *GetRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetContainer sets the container structure. func (m *GetResponse_Body) SetContainer(v *Container) { - if m != nil { - m.Container = v - } + m.Container = v } // SetSessionToken sets token of the session within which requested // container was created. func (m *GetResponse_Body) SetSessionToken(v *session.SessionToken) { - if m != nil { - m.SessionToken = v - } + m.SessionToken = v } // SetSignature sets signature of the container structure. func (m *GetResponse_Body) SetSignature(v *refs.SignatureRFC6979) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetBody sets body of the response. func (m *GetResponse) SetBody(v *GetResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetOwnerId sets identifier of the container owner. func (m *ListRequest_Body) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetBody sets body of the request. func (m *ListRequest) SetBody(v *ListRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *ListRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *ListRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetContainerIds sets list of the container identifiers. func (m *ListResponse_Body) SetContainerIds(v []*refs.ContainerID) { - if m != nil { - m.ContainerIds = v - } + m.ContainerIds = v } // SetBody sets body of the response. func (m *ListResponse) SetBody(v *ListResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *ListResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *ListResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetEacl sets eACL table structure. func (m *SetExtendedACLRequest_Body) SetEacl(v *acl.EACLTable) { - if m != nil { - m.Eacl = v - } + m.Eacl = v } // SetSignature sets signature of the eACL table structure. func (m *SetExtendedACLRequest_Body) SetSignature(v *refs.SignatureRFC6979) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetBody sets body of the request. func (m *SetExtendedACLRequest) SetBody(v *SetExtendedACLRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *SetExtendedACLRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *SetExtendedACLRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetBody sets body of the response. func (m *SetExtendedACLResponse) SetBody(v *SetExtendedACLResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *SetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *SetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetContainerId sets identifier of the container. func (m *GetExtendedACLRequest_Body) SetContainerId(v *refs.ContainerID) { - if m != nil { - m.ContainerId = v - } + m.ContainerId = v } // SetBody sets body of the request. func (m *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *GetExtendedACLRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *GetExtendedACLRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetEacl sets eACL table structure. func (m *GetExtendedACLResponse_Body) SetEacl(v *acl.EACLTable) { - if m != nil { - m.Eacl = v - } + m.Eacl = v } // SetSignature sets signature of the eACL table structure. func (m *GetExtendedACLResponse_Body) SetSignature(v *refs.SignatureRFC6979) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetSessionToken sets token of the session within which requested // eACl table was set. func (m *GetExtendedACLResponse_Body) SetSessionToken(v *session.SessionToken) { - if m != nil { - m.SessionToken = v - } + m.SessionToken = v } // SetBody sets body of the response. func (m *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *GetExtendedACLResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *GetExtendedACLResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetEpoch sets epoch of the size estimation. func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetEpoch(v uint64) { - if m != nil { - m.Epoch = v - } + m.Epoch = v } // SetContainerId sets identifier of the container. func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetContainerId(v *refs.ContainerID) { - if m != nil { - m.ContainerId = v - } + m.ContainerId = v } // SetUsedSpace sets used space value of the container. func (m *AnnounceUsedSpaceRequest_Body_Announcement) SetUsedSpace(v uint64) { - if m != nil { - m.UsedSpace = v - } + m.UsedSpace = v } // SetAnnouncements sets list of announcement for shared containers between nodes. func (m *AnnounceUsedSpaceRequest_Body) SetAnnouncements(v []*AnnounceUsedSpaceRequest_Body_Announcement) { - if m != nil { - m.Announcements = v - } + m.Announcements = v } // SetBody sets body of the request. func (m *AnnounceUsedSpaceRequest) SetBody(v *AnnounceUsedSpaceRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *AnnounceUsedSpaceRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *AnnounceUsedSpaceRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetBody sets body of the response. func (m *AnnounceUsedSpaceResponse) SetBody(v *AnnounceUsedSpaceResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *AnnounceUsedSpaceResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *AnnounceUsedSpaceResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } diff --git a/container/grpc/types.go b/container/grpc/types.go index 9fed6b2..2bb9b8b 100644 --- a/container/grpc/types.go +++ b/container/grpc/types.go @@ -7,56 +7,40 @@ import ( // SetKey sets key to the container attribute. func (m *Container_Attribute) SetKey(v string) { - if m != nil { - m.Key = v - } + m.Key = v } // SetValue sets value of the container attribute. func (m *Container_Attribute) SetValue(v string) { - if m != nil { - m.Value = v - } + m.Value = v } // SetOwnerId sets identifier of the container owner, func (m *Container) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetNonce sets nonce of the container structure. func (m *Container) SetNonce(v []byte) { - if m != nil { - m.Nonce = v - } + m.Nonce = v } // SetBasicAcl sets basic ACL of the container. func (m *Container) SetBasicAcl(v uint32) { - if m != nil { - m.BasicAcl = v - } + m.BasicAcl = v } // SetAttributes sets list of the container attributes. func (m *Container) SetAttributes(v []*Container_Attribute) { - if m != nil { - m.Attributes = v - } + m.Attributes = v } // SetPlacementPolicy sets placement policy of the container. func (m *Container) SetPlacementPolicy(v *netmap.PlacementPolicy) { - if m != nil { - m.PlacementPolicy = v - } + m.PlacementPolicy = v } // SetVersion sets version of the container. func (m *Container) SetVersion(v *refs.Version) { - if m != nil { - m.Version = v - } + m.Version = v } diff --git a/container/types.go b/container/types.go index 25755a8..215f830 100644 --- a/container/types.go +++ b/container/types.go @@ -189,9 +189,7 @@ func (a *Attribute) GetKey() string { } func (a *Attribute) SetKey(v string) { - if a != nil { - a.key = v - } + a.key = v } func (a *Attribute) GetValue() string { @@ -203,9 +201,7 @@ func (a *Attribute) GetValue() string { } func (a *Attribute) SetValue(v string) { - if a != nil { - a.val = v - } + a.val = v } func (c *Container) GetVersion() *refs.Version { @@ -217,9 +213,7 @@ func (c *Container) GetVersion() *refs.Version { } func (c *Container) SetVersion(v *refs.Version) { - if c != nil { - c.version = v - } + c.version = v } func (c *Container) GetOwnerID() *refs.OwnerID { @@ -231,9 +225,7 @@ func (c *Container) GetOwnerID() *refs.OwnerID { } func (c *Container) SetOwnerID(v *refs.OwnerID) { - if c != nil { - c.ownerID = v - } + c.ownerID = v } func (c *Container) GetNonce() []byte { @@ -245,9 +237,7 @@ func (c *Container) GetNonce() []byte { } func (c *Container) SetNonce(v []byte) { - if c != nil { - c.nonce = v - } + c.nonce = v } func (c *Container) GetBasicACL() uint32 { @@ -259,9 +249,7 @@ func (c *Container) GetBasicACL() uint32 { } func (c *Container) SetBasicACL(v uint32) { - if c != nil { - c.basicACL = v - } + c.basicACL = v } func (c *Container) GetAttributes() []Attribute { @@ -273,9 +261,7 @@ func (c *Container) GetAttributes() []Attribute { } func (c *Container) SetAttributes(v []Attribute) { - if c != nil { - c.attr = v - } + c.attr = v } func (c *Container) GetPlacementPolicy() *netmap.PlacementPolicy { @@ -287,9 +273,7 @@ func (c *Container) GetPlacementPolicy() *netmap.PlacementPolicy { } func (c *Container) SetPlacementPolicy(v *netmap.PlacementPolicy) { - if c != nil { - c.policy = v - } + c.policy = v } func (r *PutRequestBody) GetContainer() *Container { @@ -301,9 +285,7 @@ func (r *PutRequestBody) GetContainer() *Container { } func (r *PutRequestBody) SetContainer(v *Container) { - if r != nil { - r.cnr = v - } + r.cnr = v } func (r *PutRequestBody) GetSignature() *refs.Signature { @@ -315,11 +297,9 @@ func (r *PutRequestBody) GetSignature() *refs.Signature { } func (r *PutRequestBody) SetSignature(v *refs.Signature) { - if r != nil { - // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) - v.SetScheme(0) - r.sig = v - } + // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) + v.SetScheme(0) + r.sig = v } func (r *PutRequest) GetBody() *PutRequestBody { @@ -331,9 +311,7 @@ func (r *PutRequest) GetBody() *PutRequestBody { } func (r *PutRequest) SetBody(v *PutRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *PutResponseBody) GetContainerID() *refs.ContainerID { @@ -345,9 +323,7 @@ func (r *PutResponseBody) GetContainerID() *refs.ContainerID { } func (r *PutResponseBody) SetContainerID(v *refs.ContainerID) { - if r != nil { - r.cid = v - } + r.cid = v } func (r *PutResponse) GetBody() *PutResponseBody { @@ -359,9 +335,7 @@ func (r *PutResponse) GetBody() *PutResponseBody { } func (r *PutResponse) SetBody(v *PutResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetRequestBody) GetContainerID() *refs.ContainerID { @@ -373,9 +347,7 @@ func (r *GetRequestBody) GetContainerID() *refs.ContainerID { } func (r *GetRequestBody) SetContainerID(v *refs.ContainerID) { - if r != nil { - r.cid = v - } + r.cid = v } func (r *GetRequest) GetBody() *GetRequestBody { @@ -387,9 +359,7 @@ func (r *GetRequest) GetBody() *GetRequestBody { } func (r *GetRequest) SetBody(v *GetRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetResponseBody) GetContainer() *Container { @@ -401,9 +371,7 @@ func (r *GetResponseBody) GetContainer() *Container { } func (r *GetResponseBody) SetContainer(v *Container) { - if r != nil { - r.cnr = v - } + r.cnr = v } // GetSessionToken returns token of the session within which requested @@ -419,9 +387,7 @@ func (r *GetResponseBody) GetSessionToken() *session.Token { // SetSessionToken sets token of the session within which requested // container was created. func (r *GetResponseBody) SetSessionToken(v *session.Token) { - if r != nil { - r.token = v - } + r.token = v } // GetSignature returns signature of the requested container. @@ -435,11 +401,9 @@ func (r *GetResponseBody) GetSignature() *refs.Signature { // SetSignature sets signature of the requested container. func (r *GetResponseBody) SetSignature(v *refs.Signature) { - if r != nil { - // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) - v.SetScheme(0) - r.sig = v - } + // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) + v.SetScheme(0) + r.sig = v } func (r *GetResponse) GetBody() *GetResponseBody { @@ -451,9 +415,7 @@ func (r *GetResponse) GetBody() *GetResponseBody { } func (r *GetResponse) SetBody(v *GetResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *DeleteRequestBody) GetContainerID() *refs.ContainerID { @@ -465,9 +427,7 @@ func (r *DeleteRequestBody) GetContainerID() *refs.ContainerID { } func (r *DeleteRequestBody) SetContainerID(v *refs.ContainerID) { - if r != nil { - r.cid = v - } + r.cid = v } func (r *DeleteRequestBody) GetSignature() *refs.Signature { @@ -479,11 +439,9 @@ func (r *DeleteRequestBody) GetSignature() *refs.Signature { } func (r *DeleteRequestBody) SetSignature(v *refs.Signature) { - if r != nil { - // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) - v.SetScheme(0) - r.sig = v - } + // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) + v.SetScheme(0) + r.sig = v } func (r *DeleteRequest) GetBody() *DeleteRequestBody { @@ -495,9 +453,7 @@ func (r *DeleteRequest) GetBody() *DeleteRequestBody { } func (r *DeleteRequest) SetBody(v *DeleteRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *DeleteResponse) GetBody() *DeleteResponseBody { @@ -509,9 +465,7 @@ func (r *DeleteResponse) GetBody() *DeleteResponseBody { } func (r *DeleteResponse) SetBody(v *DeleteResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *ListRequestBody) GetOwnerID() *refs.OwnerID { @@ -523,9 +477,7 @@ func (r *ListRequestBody) GetOwnerID() *refs.OwnerID { } func (r *ListRequestBody) SetOwnerID(v *refs.OwnerID) { - if r != nil { - r.ownerID = v - } + r.ownerID = v } func (r *ListRequest) GetBody() *ListRequestBody { @@ -537,9 +489,7 @@ func (r *ListRequest) GetBody() *ListRequestBody { } func (r *ListRequest) SetBody(v *ListRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *ListResponseBody) GetContainerIDs() []refs.ContainerID { @@ -551,9 +501,7 @@ func (r *ListResponseBody) GetContainerIDs() []refs.ContainerID { } func (r *ListResponseBody) SetContainerIDs(v []refs.ContainerID) { - if r != nil { - r.cidList = v - } + r.cidList = v } func (r *ListResponse) GetBody() *ListResponseBody { @@ -565,9 +513,7 @@ func (r *ListResponse) GetBody() *ListResponseBody { } func (r *ListResponse) SetBody(v *ListResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *SetExtendedACLRequestBody) GetEACL() *acl.Table { @@ -579,9 +525,7 @@ func (r *SetExtendedACLRequestBody) GetEACL() *acl.Table { } func (r *SetExtendedACLRequestBody) SetEACL(v *acl.Table) { - if r != nil { - r.eacl = v - } + r.eacl = v } func (r *SetExtendedACLRequestBody) GetSignature() *refs.Signature { @@ -593,11 +537,9 @@ func (r *SetExtendedACLRequestBody) GetSignature() *refs.Signature { } func (r *SetExtendedACLRequestBody) SetSignature(v *refs.Signature) { - if r != nil { - // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) - v.SetScheme(0) - r.sig = v - } + // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) + v.SetScheme(0) + r.sig = v } func (r *SetExtendedACLRequest) GetBody() *SetExtendedACLRequestBody { @@ -609,9 +551,7 @@ func (r *SetExtendedACLRequest) GetBody() *SetExtendedACLRequestBody { } func (r *SetExtendedACLRequest) SetBody(v *SetExtendedACLRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *SetExtendedACLResponse) GetBody() *SetExtendedACLResponseBody { @@ -623,9 +563,7 @@ func (r *SetExtendedACLResponse) GetBody() *SetExtendedACLResponseBody { } func (r *SetExtendedACLResponse) SetBody(v *SetExtendedACLResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetExtendedACLRequestBody) GetContainerID() *refs.ContainerID { @@ -637,9 +575,7 @@ func (r *GetExtendedACLRequestBody) GetContainerID() *refs.ContainerID { } func (r *GetExtendedACLRequestBody) SetContainerID(v *refs.ContainerID) { - if r != nil { - r.cid = v - } + r.cid = v } func (r *GetExtendedACLRequest) GetBody() *GetExtendedACLRequestBody { @@ -651,9 +587,7 @@ func (r *GetExtendedACLRequest) GetBody() *GetExtendedACLRequestBody { } func (r *GetExtendedACLRequest) SetBody(v *GetExtendedACLRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetExtendedACLResponseBody) GetEACL() *acl.Table { @@ -665,9 +599,7 @@ func (r *GetExtendedACLResponseBody) GetEACL() *acl.Table { } func (r *GetExtendedACLResponseBody) SetEACL(v *acl.Table) { - if r != nil { - r.eacl = v - } + r.eacl = v } func (r *GetExtendedACLResponseBody) GetSignature() *refs.Signature { @@ -679,11 +611,9 @@ func (r *GetExtendedACLResponseBody) GetSignature() *refs.Signature { } func (r *GetExtendedACLResponseBody) SetSignature(v *refs.Signature) { - if r != nil { - // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) - v.SetScheme(0) - r.sig = v - } + // TODO: (neofs-api-go#381) avoid this hack (e.g. create refs.SignatureRFC6979 type) + v.SetScheme(0) + r.sig = v } // GetSessionToken returns token of the session within which requested @@ -699,9 +629,7 @@ func (r *GetExtendedACLResponseBody) GetSessionToken() *session.Token { // SetSessionToken sets token of the session within which requested // eACL table was set. func (r *GetExtendedACLResponseBody) SetSessionToken(v *session.Token) { - if r != nil { - r.token = v - } + r.token = v } func (r *GetExtendedACLResponse) GetBody() *GetExtendedACLResponseBody { @@ -713,9 +641,7 @@ func (r *GetExtendedACLResponse) GetBody() *GetExtendedACLResponseBody { } func (r *GetExtendedACLResponse) SetBody(v *GetExtendedACLResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (a *UsedSpaceAnnouncement) GetEpoch() uint64 { @@ -727,9 +653,7 @@ func (a *UsedSpaceAnnouncement) GetEpoch() uint64 { } func (a *UsedSpaceAnnouncement) SetEpoch(v uint64) { - if a != nil { - a.epoch = v - } + a.epoch = v } func (a *UsedSpaceAnnouncement) GetUsedSpace() uint64 { @@ -741,9 +665,7 @@ func (a *UsedSpaceAnnouncement) GetUsedSpace() uint64 { } func (a *UsedSpaceAnnouncement) SetUsedSpace(v uint64) { - if a != nil { - a.usedSpace = v - } + a.usedSpace = v } func (a *UsedSpaceAnnouncement) GetContainerID() *refs.ContainerID { @@ -755,9 +677,7 @@ func (a *UsedSpaceAnnouncement) GetContainerID() *refs.ContainerID { } func (a *UsedSpaceAnnouncement) SetContainerID(v *refs.ContainerID) { - if a != nil { - a.cid = v - } + a.cid = v } func (r *AnnounceUsedSpaceRequestBody) GetAnnouncements() []UsedSpaceAnnouncement { @@ -769,9 +689,7 @@ func (r *AnnounceUsedSpaceRequestBody) GetAnnouncements() []UsedSpaceAnnouncemen } func (r *AnnounceUsedSpaceRequestBody) SetAnnouncements(v []UsedSpaceAnnouncement) { - if r != nil { - r.announcements = v - } + r.announcements = v } func (r *AnnounceUsedSpaceRequest) GetBody() *AnnounceUsedSpaceRequestBody { @@ -783,9 +701,7 @@ func (r *AnnounceUsedSpaceRequest) GetBody() *AnnounceUsedSpaceRequestBody { } func (r *AnnounceUsedSpaceRequest) SetBody(v *AnnounceUsedSpaceRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *AnnounceUsedSpaceResponse) GetBody() *AnnounceUsedSpaceResponseBody { @@ -797,7 +713,5 @@ func (r *AnnounceUsedSpaceResponse) GetBody() *AnnounceUsedSpaceResponseBody { } func (r *AnnounceUsedSpaceResponse) SetBody(v *AnnounceUsedSpaceResponseBody) { - if r != nil { - r.body = v - } + r.body = v } diff --git a/netmap/grpc/service.go b/netmap/grpc/service.go index 36ed88d..0061631 100644 --- a/netmap/grpc/service.go +++ b/netmap/grpc/service.go @@ -7,105 +7,75 @@ import ( // SetBody sets body of the request. func (m *LocalNodeInfoRequest) SetBody(v *LocalNodeInfoRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *LocalNodeInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *LocalNodeInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetVersion sets version of response body. func (m *LocalNodeInfoResponse_Body) SetVersion(v *refs.Version) { - if m != nil { - m.Version = v - } + m.Version = v } // SetNodeInfo sets node info of response body. func (m *LocalNodeInfoResponse_Body) SetNodeInfo(v *NodeInfo) { - if m != nil { - m.NodeInfo = v - } + m.NodeInfo = v } // SetBody sets body of the response. func (m *LocalNodeInfoResponse) SetBody(v *LocalNodeInfoResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *LocalNodeInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *LocalNodeInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetBody sets body of the request. func (x *NetworkInfoRequest) SetBody(v *NetworkInfoRequest_Body) { - if x != nil { - x.Body = v - } + x.Body = v } // SetMetaHeader sets meta header of the request. func (x *NetworkInfoRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if x != nil { - x.MetaHeader = v - } + x.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (x *NetworkInfoRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if x != nil { - x.VerifyHeader = v - } + x.VerifyHeader = v } // SetNetworkInfo sets information about the network. func (x *NetworkInfoResponse_Body) SetNetworkInfo(v *NetworkInfo) { - if x != nil { - x.NetworkInfo = v - } + x.NetworkInfo = v } // SetBody sets body of the response. func (x *NetworkInfoResponse) SetBody(v *NetworkInfoResponse_Body) { - if x != nil { - x.Body = v - } + x.Body = v } // SetMetaHeader sets meta header of the response. func (x *NetworkInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if x != nil { - x.MetaHeader = v - } + x.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (x *NetworkInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if x != nil { - x.VerifyHeader = v - } + x.VerifyHeader = v } diff --git a/netmap/grpc/types.go b/netmap/grpc/types.go index 95b0acc..940404a 100644 --- a/netmap/grpc/types.go +++ b/netmap/grpc/types.go @@ -4,142 +4,102 @@ import refs "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc" // SetReplicas of placement policy. func (m *PlacementPolicy) SetReplicas(v []*Replica) { - if m != nil { - m.Replicas = v - } + m.Replicas = v } // SetContainerBackupFactor of placement policy. func (m *PlacementPolicy) SetContainerBackupFactor(v uint32) { - if m != nil { - m.ContainerBackupFactor = v - } + m.ContainerBackupFactor = v } // SetSelectors of placement policy. func (m *PlacementPolicy) SetSelectors(v []*Selector) { - if m != nil { - m.Selectors = v - } + m.Selectors = v } // SetFilters of placement policy. func (m *PlacementPolicy) SetFilters(v []*Filter) { - if m != nil { - m.Filters = v - } + m.Filters = v } // SetSubnetID sets ID of subnet. func (m *PlacementPolicy) SetSubnetID(v *refs.SubnetID) { - if m != nil { - m.SubnetId = v - } + m.SubnetId = v } // SetName of placement filter. func (m *Filter) SetName(v string) { - if m != nil { - m.Name = v - } + m.Name = v } // SetKey of placement filter. func (m *Filter) SetKey(v string) { - if m != nil { - m.Key = v - } + m.Key = v } // SetOperation of placement filter. func (m *Filter) SetOp(v Operation) { - if m != nil { - m.Op = v - } + m.Op = v } // SetValue of placement filter. func (m *Filter) SetValue(v string) { - if m != nil { - m.Value = v - } + m.Value = v } // SetFilters sets sub-filters of placement filter. func (m *Filter) SetFilters(v []*Filter) { - if m != nil { - m.Filters = v - } + m.Filters = v } // SetName of placement selector. func (m *Selector) SetName(v string) { - if m != nil { - m.Name = v - } + m.Name = v } // SetCount of nodes of placement selector. func (m *Selector) SetCount(v uint32) { - if m != nil { - m.Count = v - } + m.Count = v } // SetAttribute of nodes of placement selector. func (m *Selector) SetAttribute(v string) { - if m != nil { - m.Attribute = v - } + m.Attribute = v } // SetFilter of placement selector. func (m *Selector) SetFilter(v string) { - if m != nil { - m.Filter = v - } + m.Filter = v } // SetClause of placement selector. func (m *Selector) SetClause(v Clause) { - if m != nil { - m.Clause = v - } + m.Clause = v } // SetCount of object replica. func (m *Replica) SetCount(v uint32) { - if m != nil { - m.Count = v - } + m.Count = v } // SetSelector of object replica. func (m *Replica) SetSelector(v string) { - if m != nil { - m.Selector = v - } + m.Selector = v } // SetKey sets key to the node attribute. func (m *NodeInfo_Attribute) SetKey(v string) { - if m != nil { - m.Key = v - } + m.Key = v } // SetValue sets value of the node attribute. func (m *NodeInfo_Attribute) SetValue(v string) { - if m != nil { - m.Value = v - } + m.Value = v } // SetParent sets value of the node parents. func (m *NodeInfo_Attribute) SetParents(v []string) { - if m != nil { - m.Parents = v - } + m.Parents = v } // SetAddress sets node network address. @@ -151,58 +111,42 @@ func (m *NodeInfo) SetAddress(v string) { // SetAddresses sets list of network addresses of the node. func (m *NodeInfo) SetAddresses(v []string) { - if m != nil { - m.Addresses = v - } + m.Addresses = v } // SetPublicKey sets node public key in a binary format. func (m *NodeInfo) SetPublicKey(v []byte) { - if m != nil { - m.PublicKey = v - } + m.PublicKey = v } // SetAttributes sets list of the node attributes. func (m *NodeInfo) SetAttributes(v []*NodeInfo_Attribute) { - if m != nil { - m.Attributes = v - } + m.Attributes = v } // SetState sets node state. func (m *NodeInfo) SetState(v NodeInfo_State) { - if m != nil { - m.State = v - } + m.State = v } // SetCurrentEpoch sets number of the current epoch. func (x *NetworkInfo) SetCurrentEpoch(v uint64) { - if x != nil { - x.CurrentEpoch = v - } + x.CurrentEpoch = v } // SetMagicNumber sets magic number of the sidechain. func (x *NetworkInfo) SetMagicNumber(v uint64) { - if x != nil { - x.MagicNumber = v - } + x.MagicNumber = v } // SetMsPerBlock sets MillisecondsPerBlock network parameter. func (x *NetworkInfo) SetMsPerBlock(v int64) { - if x != nil { - x.MsPerBlock = v - } + x.MsPerBlock = v } // SetNetworkConfig sets NeoFS network configuration. func (x *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { - if x != nil { - x.NetworkConfig = v - } + x.NetworkConfig = v } // FromString parses Clause from a string representation, @@ -246,21 +190,15 @@ func (x *NodeInfo_State) FromString(s string) bool { // SetKey sets parameter key. func (x *NetworkConfig_Parameter) SetKey(v []byte) { - if x != nil { - x.Key = v - } + x.Key = v } // SetValue sets parameter value. func (x *NetworkConfig_Parameter) SetValue(v []byte) { - if x != nil { - x.Value = v - } + x.Value = v } // SetParameters sets NeoFS network parameters. func (x *NetworkConfig) SetParameters(v []*NetworkConfig_Parameter) { - if x != nil { - x.Parameters = v - } + x.Parameters = v } diff --git a/netmap/types.go b/netmap/types.go index 19ca974..cc190af 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -123,9 +123,7 @@ func (f *Filter) GetFilters() []Filter { } func (f *Filter) SetFilters(filters []Filter) { - if f != nil { - f.filters = filters - } + f.filters = filters } func (f *Filter) GetValue() string { @@ -137,9 +135,7 @@ func (f *Filter) GetValue() string { } func (f *Filter) SetValue(value string) { - if f != nil { - f.value = value - } + f.value = value } func (f *Filter) GetOp() Operation { @@ -150,9 +146,7 @@ func (f *Filter) GetOp() Operation { } func (f *Filter) SetOp(op Operation) { - if f != nil { - f.op = op - } + f.op = op } func (f *Filter) GetKey() string { @@ -164,9 +158,7 @@ func (f *Filter) GetKey() string { } func (f *Filter) SetKey(key string) { - if f != nil { - f.key = key - } + f.key = key } func (f *Filter) GetName() string { @@ -178,9 +170,7 @@ func (f *Filter) GetName() string { } func (f *Filter) SetName(name string) { - if f != nil { - f.name = name - } + f.name = name } func (s *Selector) GetFilter() string { @@ -192,9 +182,7 @@ func (s *Selector) GetFilter() string { } func (s *Selector) SetFilter(filter string) { - if s != nil { - s.filter = filter - } + s.filter = filter } func (s *Selector) GetAttribute() string { @@ -206,9 +194,7 @@ func (s *Selector) GetAttribute() string { } func (s *Selector) SetAttribute(attribute string) { - if s != nil { - s.attribute = attribute - } + s.attribute = attribute } func (s *Selector) GetClause() Clause { @@ -220,9 +206,7 @@ func (s *Selector) GetClause() Clause { } func (s *Selector) SetClause(clause Clause) { - if s != nil { - s.clause = clause - } + s.clause = clause } func (s *Selector) GetCount() uint32 { @@ -234,9 +218,7 @@ func (s *Selector) GetCount() uint32 { } func (s *Selector) SetCount(count uint32) { - if s != nil { - s.count = count - } + s.count = count } func (s *Selector) GetName() string { @@ -248,9 +230,7 @@ func (s *Selector) GetName() string { } func (s *Selector) SetName(name string) { - if s != nil { - s.name = name - } + s.name = name } func (r *Replica) GetSelector() string { @@ -262,9 +242,7 @@ func (r *Replica) GetSelector() string { } func (r *Replica) SetSelector(selector string) { - if r != nil { - r.selector = selector - } + r.selector = selector } func (r *Replica) GetCount() uint32 { @@ -276,9 +254,7 @@ func (r *Replica) GetCount() uint32 { } func (r *Replica) SetCount(count uint32) { - if r != nil { - r.count = count - } + r.count = count } func (p *PlacementPolicy) GetFilters() []Filter { @@ -290,9 +266,7 @@ func (p *PlacementPolicy) GetFilters() []Filter { } func (p *PlacementPolicy) SetFilters(filters []Filter) { - if p != nil { - p.filters = filters - } + p.filters = filters } func (p *PlacementPolicy) GetSelectors() []Selector { @@ -304,9 +278,7 @@ func (p *PlacementPolicy) GetSelectors() []Selector { } func (p *PlacementPolicy) SetSelectors(selectors []Selector) { - if p != nil { - p.selectors = selectors - } + p.selectors = selectors } func (p *PlacementPolicy) GetContainerBackupFactor() uint32 { @@ -318,9 +290,7 @@ func (p *PlacementPolicy) GetContainerBackupFactor() uint32 { } func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32) { - if p != nil { - p.backupFactor = backupFactor - } + p.backupFactor = backupFactor } func (p *PlacementPolicy) GetReplicas() []Replica { @@ -348,9 +318,7 @@ func (a *Attribute) GetKey() string { } func (a *Attribute) SetKey(v string) { - if a != nil { - a.key = v - } + a.key = v } func (a *Attribute) GetValue() string { @@ -362,9 +330,7 @@ func (a *Attribute) GetValue() string { } func (a *Attribute) SetValue(v string) { - if a != nil { - a.value = v - } + a.value = v } func (a *Attribute) GetParents() []string { @@ -376,9 +342,7 @@ func (a *Attribute) GetParents() []string { } func (a *Attribute) SetParents(parent []string) { - if a != nil { - a.parents = parent - } + a.parents = parent } func (ni *NodeInfo) GetPublicKey() []byte { @@ -390,9 +354,7 @@ func (ni *NodeInfo) GetPublicKey() []byte { } func (ni *NodeInfo) SetPublicKey(v []byte) { - if ni != nil { - ni.publicKey = v - } + ni.publicKey = v } // GetAddress returns node's network address. @@ -416,9 +378,7 @@ func (ni *NodeInfo) SetAddress(v string) { // SetAddresses sets list of network addresses of the node. func (ni *NodeInfo) SetAddresses(v ...string) { - if ni != nil { - ni.addresses = v - } + ni.addresses = v } // NumberOfAddresses returns number of network addresses of the node. @@ -453,9 +413,7 @@ func (ni *NodeInfo) GetAttributes() []Attribute { } func (ni *NodeInfo) SetAttributes(v []Attribute) { - if ni != nil { - ni.attributes = v - } + ni.attributes = v } func (ni *NodeInfo) GetState() NodeState { @@ -467,9 +425,7 @@ func (ni *NodeInfo) GetState() NodeState { } func (ni *NodeInfo) SetState(state NodeState) { - if ni != nil { - ni.state = state - } + ni.state = state } func (l *LocalNodeInfoResponseBody) GetVersion() *refs.Version { @@ -481,9 +437,7 @@ func (l *LocalNodeInfoResponseBody) GetVersion() *refs.Version { } func (l *LocalNodeInfoResponseBody) SetVersion(version *refs.Version) { - if l != nil { - l.version = version - } + l.version = version } func (l *LocalNodeInfoResponseBody) GetNodeInfo() *NodeInfo { @@ -495,9 +449,7 @@ func (l *LocalNodeInfoResponseBody) GetNodeInfo() *NodeInfo { } func (l *LocalNodeInfoResponseBody) SetNodeInfo(nodeInfo *NodeInfo) { - if l != nil { - l.nodeInfo = nodeInfo - } + l.nodeInfo = nodeInfo } func (l *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequestBody { @@ -508,9 +460,7 @@ func (l *LocalNodeInfoRequest) GetBody() *LocalNodeInfoRequestBody { } func (l *LocalNodeInfoRequest) SetBody(body *LocalNodeInfoRequestBody) { - if l != nil { - l.body = body - } + l.body = body } func (l *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponseBody { @@ -521,9 +471,7 @@ func (l *LocalNodeInfoResponse) GetBody() *LocalNodeInfoResponseBody { } func (l *LocalNodeInfoResponse) SetBody(body *LocalNodeInfoResponseBody) { - if l != nil { - l.body = body - } + l.body = body } // NetworkParameter represents NeoFS network parameter. @@ -542,9 +490,7 @@ func (x *NetworkParameter) GetKey() []byte { // SetKey sets parameter key. func (x *NetworkParameter) SetKey(k []byte) { - if x != nil { - x.k = k - } + x.k = k } // GetValue returns parameter value. @@ -558,9 +504,7 @@ func (x *NetworkParameter) GetValue() []byte { // SetValue sets parameter value. func (x *NetworkParameter) SetValue(v []byte) { - if x != nil { - x.v = v - } + x.v = v } // NetworkConfig represents NeoFS network configuration. @@ -593,9 +537,7 @@ func (x *NetworkConfig) IterateParameters(f func(*NetworkParameter) bool) { // SetParameters sets list of network parameters. func (x *NetworkConfig) SetParameters(v ...NetworkParameter) { - if x != nil { - x.ps = v - } + x.ps = v } // NetworkInfo groups information about @@ -619,9 +561,7 @@ func (i *NetworkInfo) GetCurrentEpoch() uint64 { // SetCurrentEpoch sets number of the current epoch. func (i *NetworkInfo) SetCurrentEpoch(epoch uint64) { - if i != nil { - i.curEpoch = epoch - } + i.curEpoch = epoch } // GetMagicNumber returns magic number of the sidechain. @@ -635,9 +575,7 @@ func (i *NetworkInfo) GetMagicNumber() uint64 { // SetMagicNumber sets magic number of the sidechain. func (i *NetworkInfo) SetMagicNumber(magic uint64) { - if i != nil { - i.magicNum = magic - } + i.magicNum = magic } // GetMsPerBlock returns MillisecondsPerBlock network parameter. @@ -651,9 +589,7 @@ func (i *NetworkInfo) GetMsPerBlock() int64 { // SetMsPerBlock sets MillisecondsPerBlock network parameter. func (i *NetworkInfo) SetMsPerBlock(v int64) { - if i != nil { - i.msPerBlock = v - } + i.msPerBlock = v } // GetNetworkConfig returns NeoFS network configuration. @@ -667,9 +603,7 @@ func (i *NetworkInfo) GetNetworkConfig() *NetworkConfig { // SetNetworkConfig sets NeoFS network configuration. func (i *NetworkInfo) SetNetworkConfig(v *NetworkConfig) { - if i != nil { - i.netCfg = v - } + i.netCfg = v } // NetworkInfoRequestBody is a structure of NetworkInfo request body. @@ -691,9 +625,7 @@ func (i *NetworkInfoResponseBody) GetNetworkInfo() *NetworkInfo { // SetNetworkInfo sets information about the NeoFS network. func (i *NetworkInfoResponseBody) SetNetworkInfo(netInfo *NetworkInfo) { - if i != nil { - i.netInfo = netInfo - } + i.netInfo = netInfo } func (l *NetworkInfoRequest) GetBody() *NetworkInfoRequestBody { @@ -704,9 +636,7 @@ func (l *NetworkInfoRequest) GetBody() *NetworkInfoRequestBody { } func (l *NetworkInfoRequest) SetBody(body *NetworkInfoRequestBody) { - if l != nil { - l.body = body - } + l.body = body } func (l *NetworkInfoResponse) GetBody() *NetworkInfoResponseBody { @@ -717,7 +647,5 @@ func (l *NetworkInfoResponse) GetBody() *NetworkInfoResponseBody { } func (l *NetworkInfoResponse) SetBody(body *NetworkInfoResponseBody) { - if l != nil { - l.body = body - } + l.body = body } diff --git a/object/grpc/service.go b/object/grpc/service.go index e9b7659..b77208f 100644 --- a/object/grpc/service.go +++ b/object/grpc/service.go @@ -7,58 +7,42 @@ import ( // SetAddress sets address of the requested object. func (m *GetRequest_Body) SetAddress(v *refs.Address) { - if m != nil { - m.Address = v - } + m.Address = v } // SetRaw sets raw flag of the request. func (m *GetRequest_Body) SetRaw(v bool) { - if m != nil { - m.Raw = v - } + m.Raw = v } // SetBody sets body of the request. func (m *GetRequest) SetBody(v *GetRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *GetRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *GetRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetObjectId sets identifier of the object. func (m *GetResponse_Body_Init) SetObjectId(v *refs.ObjectID) { - if m != nil { - m.ObjectId = v - } + m.ObjectId = v } // SetSignature sets signature of the object identifier. func (m *GetResponse_Body_Init) SetSignature(v *refs.Signature) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetHeader sets header of the object. func (m *GetResponse_Body_Init) SetHeader(v *Header) { - if m != nil { - m.Header = v - } + m.Header = v } // GetChunk returns chunk of the object payload bytes. @@ -72,83 +56,61 @@ func (m *GetResponse_Body_Chunk) GetChunk() []byte { // SetChunk sets chunk of the object payload bytes. func (m *GetResponse_Body_Chunk) SetChunk(v []byte) { - if m != nil { - m.Chunk = v - } + m.Chunk = v } // SetInit sets initial part of the object. func (m *GetResponse_Body) SetInit(v *GetResponse_Body_Init) { - if m != nil { - m.ObjectPart = &GetResponse_Body_Init_{ - Init: v, - } + m.ObjectPart = &GetResponse_Body_Init_{ + Init: v, } } // SetChunk sets part of the object payload. func (m *GetResponse_Body) SetChunk(v *GetResponse_Body_Chunk) { - if m != nil { - m.ObjectPart = v - } + m.ObjectPart = v } // SetSplitInfo sets part of the object payload. func (m *GetResponse_Body) SetSplitInfo(v *SplitInfo) { - if m != nil { - m.ObjectPart = &GetResponse_Body_SplitInfo{ - SplitInfo: v, - } + m.ObjectPart = &GetResponse_Body_SplitInfo{ + SplitInfo: v, } } // SetBody sets body of the response. func (m *GetResponse) SetBody(v *GetResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *GetResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *GetResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetObjectId sets identifier of the object. func (m *PutRequest_Body_Init) SetObjectId(v *refs.ObjectID) { - if m != nil { - m.ObjectId = v - } + m.ObjectId = v } // SetSignature sets signature of the object identifier. func (m *PutRequest_Body_Init) SetSignature(v *refs.Signature) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetHeader sets header of the object. func (m *PutRequest_Body_Init) SetHeader(v *Header) { - if m != nil { - m.Header = v - } + m.Header = v } // SetCopiesNumber sets number of the copies to save. func (m *PutRequest_Body_Init) SetCopiesNumber(v uint32) { - if m != nil { - m.CopiesNumber = v - } + m.CopiesNumber = v } // GetChunk returns chunk of the object payload bytes. @@ -162,381 +124,275 @@ func (m *PutRequest_Body_Chunk) GetChunk() []byte { // SetChunk sets chunk of the object payload bytes. func (m *PutRequest_Body_Chunk) SetChunk(v []byte) { - if m != nil { - m.Chunk = v - } + m.Chunk = v } // SetInit sets initial part of the object. func (m *PutRequest_Body) SetInit(v *PutRequest_Body_Init) { - if m != nil { - m.ObjectPart = &PutRequest_Body_Init_{ - Init: v, - } + m.ObjectPart = &PutRequest_Body_Init_{ + Init: v, } } // SetChunk sets part of the object payload. func (m *PutRequest_Body) SetChunk(v *PutRequest_Body_Chunk) { - if m != nil { - m.ObjectPart = v - } + m.ObjectPart = v } // SetBody sets body of the request. func (m *PutRequest) SetBody(v *PutRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *PutRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *PutRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetObjectId sets identifier of the saved object. func (m *PutResponse_Body) SetObjectId(v *refs.ObjectID) { - if m != nil { - m.ObjectId = v - } + m.ObjectId = v } // SetBody sets body of the response. func (m *PutResponse) SetBody(v *PutResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *PutResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *PutResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetAddress sets address of the object to delete. func (m *DeleteRequest_Body) SetAddress(v *refs.Address) { - if m != nil { - m.Address = v - } + m.Address = v } // SetBody sets body of the request. func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *DeleteRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *DeleteRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetTombstone sets tombstone address. func (x *DeleteResponse_Body) SetTombstone(v *refs.Address) { - if x != nil { - x.Tombstone = v - } + x.Tombstone = v } // SetBody sets body of the response. func (m *DeleteResponse) SetBody(v *DeleteResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *DeleteResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *DeleteResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetAddress sets address of the object with the requested header. func (m *HeadRequest_Body) SetAddress(v *refs.Address) { - if m != nil { - m.Address = v - } + m.Address = v } // SetMainOnly sets flag to return the minimal header subset. func (m *HeadRequest_Body) SetMainOnly(v bool) { - if m != nil { - m.MainOnly = v - } + m.MainOnly = v } // SetRaw sets raw flag of the request. func (m *HeadRequest_Body) SetRaw(v bool) { - if m != nil { - m.Raw = v - } + m.Raw = v } // SetBody sets body of the request. func (m *HeadRequest) SetBody(v *HeadRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *HeadRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *HeadRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetHeader sets object header. func (m *HeaderWithSignature) SetHeader(v *Header) { - if m != nil { - m.Header = v - } + m.Header = v } // SetSignature of the header. func (m *HeaderWithSignature) SetSignature(v *refs.Signature) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetHeader sets full header of the object. func (m *HeadResponse_Body) SetHeader(v *HeaderWithSignature) { - if m != nil { - m.Head = &HeadResponse_Body_Header{ - Header: v, - } + m.Head = &HeadResponse_Body_Header{ + Header: v, } } // SetShortHeader sets short header of the object. func (m *HeadResponse_Body) SetShortHeader(v *ShortHeader) { - if m != nil { - m.Head = &HeadResponse_Body_ShortHeader{ - ShortHeader: v, - } + m.Head = &HeadResponse_Body_ShortHeader{ + ShortHeader: v, } } // SetSplitInfo sets meta info about split hierarchy of the object. func (m *HeadResponse_Body) SetSplitInfo(v *SplitInfo) { - if m != nil { - m.Head = &HeadResponse_Body_SplitInfo{ - SplitInfo: v, - } + m.Head = &HeadResponse_Body_SplitInfo{ + SplitInfo: v, } } // SetBody sets body of the response. func (m *HeadResponse) SetBody(v *HeadResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *HeadResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *HeadResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetMatchType sets match type of the filter. func (m *SearchRequest_Body_Filter) SetMatchType(v MatchType) { - if m != nil { - m.MatchType = v - } + m.MatchType = v } // SetKey sets key to the filtering header. func (m *SearchRequest_Body_Filter) SetKey(v string) { - if m != nil { - m.Key = v - } + m.Key = v } // SetValue sets value of the filtering header. func (m *SearchRequest_Body_Filter) SetValue(v string) { - if m != nil { - m.Value = v - } + m.Value = v } // SetVersion sets version of the search query. func (m *SearchRequest_Body) SetVersion(v uint32) { - if m != nil { - m.Version = v - } + m.Version = v } // SetFilters sets list of the query filters. func (m *SearchRequest_Body) SetFilters(v []*SearchRequest_Body_Filter) { - if m != nil { - m.Filters = v - } + m.Filters = v } // SetContainerId sets container ID of the search requets. func (m *SearchRequest_Body) SetContainerId(v *refs.ContainerID) { - if m != nil { - m.ContainerId = v - } + m.ContainerId = v } // SetBody sets body of the request. func (m *SearchRequest) SetBody(v *SearchRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *SearchRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *SearchRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetIdList sets list of the identifiers of the matched objects. func (m *SearchResponse_Body) SetIdList(v []*refs.ObjectID) { - if m != nil { - m.IdList = v - } + m.IdList = v } // SetBody sets body of the response. func (m *SearchResponse) SetBody(v *SearchResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *SearchResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *SearchResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetOffset sets offset of the payload range. func (m *Range) SetOffset(v uint64) { - if m != nil { - m.Offset = v - } + m.Offset = v } // SetLength sets length of the payload range. func (m *Range) SetLength(v uint64) { - if m != nil { - m.Length = v - } + m.Length = v } // SetAddress sets address of the object with the request payload range. func (m *GetRangeRequest_Body) SetAddress(v *refs.Address) { - if m != nil { - m.Address = v - } + m.Address = v } // SetRange sets range of the object payload. func (m *GetRangeRequest_Body) SetRange(v *Range) { - if m != nil { - m.Range = v - } + m.Range = v } // SetRaw sets raw flag of the request. func (m *GetRangeRequest_Body) SetRaw(v bool) { - if m != nil { - m.Raw = v - } + m.Raw = v } // SetBody sets body of the request. func (m *GetRangeRequest) SetBody(v *GetRangeRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *GetRangeRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *GetRangeRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // GetChunk returns chunk of the object payload range bytes. @@ -550,128 +406,92 @@ func (m *GetRangeResponse_Body_Chunk) GetChunk() []byte { // SetChunk sets chunk of the object payload range bytes. func (m *GetRangeResponse_Body_Chunk) SetChunk(v []byte) { - if m != nil { - m.Chunk = v - } + m.Chunk = v } // SetChunk sets chunk of the object payload. func (m *GetRangeResponse_Body) SetChunk(v *GetRangeResponse_Body_Chunk) { - if m != nil { - m.RangePart = v - } + m.RangePart = v } // SetSplitInfo sets meta info about split hierarchy of the object. func (m *GetRangeResponse_Body) SetSplitInfo(v *SplitInfo) { - if m != nil { - m.RangePart = &GetRangeResponse_Body_SplitInfo{ - SplitInfo: v, - } + m.RangePart = &GetRangeResponse_Body_SplitInfo{ + SplitInfo: v, } } // SetBody sets body of the response. func (m *GetRangeResponse) SetBody(v *GetRangeResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *GetRangeResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *GetRangeResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetAddress sets address of the object with the request payload range. func (m *GetRangeHashRequest_Body) SetAddress(v *refs.Address) { - if m != nil { - m.Address = v - } + m.Address = v } // SetRanges sets list of the ranges of the object payload. func (m *GetRangeHashRequest_Body) SetRanges(v []*Range) { - if m != nil { - m.Ranges = v - } + m.Ranges = v } // SetSalt sets salt for the object payload ranges. func (m *GetRangeHashRequest_Body) SetSalt(v []byte) { - if m != nil { - m.Salt = v - } + m.Salt = v } // Set sets salt for the object payload ranges. func (m *GetRangeHashRequest_Body) SetType(v refs.ChecksumType) { - if m != nil { - m.Type = v - } + m.Type = v } // SetBody sets body of the request. func (m *GetRangeHashRequest) SetBody(v *GetRangeHashRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *GetRangeHashRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *GetRangeHashRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetHashList returns list of the range hashes. func (m *GetRangeHashResponse_Body) SetHashList(v [][]byte) { - if m != nil { - m.HashList = v - } + m.HashList = v } // SetHashList returns list of the range hashes. func (m *GetRangeHashResponse_Body) SetType(v refs.ChecksumType) { - if m != nil { - m.Type = v - } + m.Type = v } // SetBody sets body of the response. func (m *GetRangeHashResponse) SetBody(v *GetRangeHashResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *GetRangeHashResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *GetRangeHashResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } diff --git a/object/grpc/types.go b/object/grpc/types.go index 350056d..10e063a 100644 --- a/object/grpc/types.go +++ b/object/grpc/types.go @@ -7,233 +7,167 @@ import ( // SetKey sets key to the object attribute. func (m *Header_Attribute) SetKey(v string) { - if m != nil { - m.Key = v - } + m.Key = v } // SetValue sets value of the object attribute. func (m *Header_Attribute) SetValue(v string) { - if m != nil { - m.Value = v - } + m.Value = v } // SetParent sets identifier of the parent object. func (m *Header_Split) SetParent(v *refs.ObjectID) { - if m != nil { - m.Parent = v - } + m.Parent = v } // SetPrevious sets identifier of the previous object in split-chain. func (m *Header_Split) SetPrevious(v *refs.ObjectID) { - if m != nil { - m.Previous = v - } + m.Previous = v } // SetParentSignature sets signature of the parent object header. func (m *Header_Split) SetParentSignature(v *refs.Signature) { - if m != nil { - m.ParentSignature = v - } + m.ParentSignature = v } // SetParentHeader sets parent header structure. func (m *Header_Split) SetParentHeader(v *Header) { - if m != nil { - m.ParentHeader = v - } + m.ParentHeader = v } // SetChildren sets list of the identifiers of the child objects. func (m *Header_Split) SetChildren(v []*refs.ObjectID) { - if m != nil { - m.Children = v - } + m.Children = v } // SetSplitId sets split ID of the object. func (m *Header_Split) SetSplitId(v []byte) { - if m != nil { - m.SplitId = v - } + m.SplitId = v } // SetContainerId sets identifier of the container. func (m *Header) SetContainerId(v *refs.ContainerID) { - if m != nil { - m.ContainerId = v - } + m.ContainerId = v } // SetOwnerId sets identifier of the object owner. func (m *Header) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetCreationEpoch sets creation epoch number. func (m *Header) SetCreationEpoch(v uint64) { - if m != nil { - m.CreationEpoch = v - } + m.CreationEpoch = v } // SetVersion sets version of the object format. func (m *Header) SetVersion(v *refs.Version) { - if m != nil { - m.Version = v - } + m.Version = v } // SetPayloadLength sets length of the object payload. func (m *Header) SetPayloadLength(v uint64) { - if m != nil { - m.PayloadLength = v - } + m.PayloadLength = v } // SetPayloadHash sets hash of the object payload. func (m *Header) SetPayloadHash(v *refs.Checksum) { - if m != nil { - m.PayloadHash = v - } + m.PayloadHash = v } // SetObjectType sets type of the object. func (m *Header) SetObjectType(v ObjectType) { - if m != nil { - m.ObjectType = v - } + m.ObjectType = v } // SetHomomorphicHash sets homomorphic hash of the object payload. func (m *Header) SetHomomorphicHash(v *refs.Checksum) { - if m != nil { - m.HomomorphicHash = v - } + m.HomomorphicHash = v } // SetSessionToken sets session token. func (m *Header) SetSessionToken(v *session.SessionToken) { - if m != nil { - m.SessionToken = v - } + m.SessionToken = v } // SetAttributes sets list of the object attributes. func (m *Header) SetAttributes(v []*Header_Attribute) { - if m != nil { - m.Attributes = v - } + m.Attributes = v } // SetSplit sets split header. func (m *Header) SetSplit(v *Header_Split) { - if m != nil { - m.Split = v - } + m.Split = v } // SetObjectId sets identifier of the object. func (m *Object) SetObjectId(v *refs.ObjectID) { - if m != nil { - m.ObjectId = v - } + m.ObjectId = v } // SetSignature sets signature of the object identifier. func (m *Object) SetSignature(v *refs.Signature) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetHeader sets header of the object. func (m *Object) SetHeader(v *Header) { - if m != nil { - m.Header = v - } + m.Header = v } // SetPayload sets payload bytes of the object. func (m *Object) SetPayload(v []byte) { - if m != nil { - m.Payload = v - } + m.Payload = v } // SetVersion sets version of the object. func (m *ShortHeader) SetVersion(v *refs.Version) { - if m != nil { - m.Version = v - } + m.Version = v } // SetCreationEpoch sets creation epoch number. func (m *ShortHeader) SetCreationEpoch(v uint64) { - if m != nil { - m.CreationEpoch = v - } + m.CreationEpoch = v } // SetOwnerId sets identifier of the object owner. func (m *ShortHeader) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetObjectType sets type of the object. func (m *ShortHeader) SetObjectType(v ObjectType) { - if m != nil { - m.ObjectType = v - } + m.ObjectType = v } // SetPayloadLength sets length of the object payload. func (m *ShortHeader) SetPayloadLength(v uint64) { - if m != nil { - m.PayloadLength = v - } + m.PayloadLength = v } // SetPayloadHash sets hash of the object payload. func (m *ShortHeader) SetPayloadHash(v *refs.Checksum) { - if m != nil { - m.PayloadHash = v - } + m.PayloadHash = v } // SetHomomorphicHash sets homomorphic hash of the object payload. func (m *ShortHeader) SetHomomorphicHash(v *refs.Checksum) { - if m != nil { - m.HomomorphicHash = v - } + m.HomomorphicHash = v } // SetSplitId sets id of split hierarchy. func (m *SplitInfo) SetSplitId(v []byte) { - if m != nil { - m.SplitId = v - } + m.SplitId = v } // SetLastPart sets id of most right child in split hierarchy. func (m *SplitInfo) SetLastPart(v *refs.ObjectID) { - if m != nil { - m.LastPart = v - } + m.LastPart = v } // SetLink sets id of linking object in split hierarchy. func (m *SplitInfo) SetLink(v *refs.ObjectID) { - if m != nil { - m.Link = v - } + m.Link = v } // FromString parses ObjectType from a string representation, diff --git a/object/types.go b/object/types.go index 240f22c..15477c1 100644 --- a/object/types.go +++ b/object/types.go @@ -325,9 +325,7 @@ func (h *ShortHeader) GetVersion() *refs.Version { } func (h *ShortHeader) SetVersion(v *refs.Version) { - if h != nil { - h.version = v - } + h.version = v } func (h *ShortHeader) GetCreationEpoch() uint64 { @@ -339,9 +337,7 @@ func (h *ShortHeader) GetCreationEpoch() uint64 { } func (h *ShortHeader) SetCreationEpoch(v uint64) { - if h != nil { - h.creatEpoch = v - } + h.creatEpoch = v } func (h *ShortHeader) GetOwnerID() *refs.OwnerID { @@ -353,9 +349,7 @@ func (h *ShortHeader) GetOwnerID() *refs.OwnerID { } func (h *ShortHeader) SetOwnerID(v *refs.OwnerID) { - if h != nil { - h.ownerID = v - } + h.ownerID = v } func (h *ShortHeader) GetObjectType() Type { @@ -367,9 +361,7 @@ func (h *ShortHeader) GetObjectType() Type { } func (h *ShortHeader) SetObjectType(v Type) { - if h != nil { - h.typ = v - } + h.typ = v } func (h *ShortHeader) GetPayloadLength() uint64 { @@ -381,9 +373,7 @@ func (h *ShortHeader) GetPayloadLength() uint64 { } func (h *ShortHeader) SetPayloadLength(v uint64) { - if h != nil { - h.payloadLen = v - } + h.payloadLen = v } func (h *ShortHeader) GetPayloadHash() *refs.Checksum { @@ -395,9 +385,7 @@ func (h *ShortHeader) GetPayloadHash() *refs.Checksum { } func (h *ShortHeader) SetPayloadHash(v *refs.Checksum) { - if h != nil { - h.payloadHash = v - } + h.payloadHash = v } func (h *ShortHeader) GetHomomorphicHash() *refs.Checksum { @@ -409,9 +397,7 @@ func (h *ShortHeader) GetHomomorphicHash() *refs.Checksum { } func (h *ShortHeader) SetHomomorphicHash(v *refs.Checksum) { - if h != nil { - h.homoHash = v - } + h.homoHash = v } func (h *ShortHeader) getHeaderPart() {} @@ -425,9 +411,7 @@ func (a *Attribute) GetKey() string { } func (a *Attribute) SetKey(v string) { - if a != nil { - a.key = v - } + a.key = v } func (a *Attribute) GetValue() string { @@ -439,9 +423,7 @@ func (a *Attribute) GetValue() string { } func (a *Attribute) SetValue(v string) { - if a != nil { - a.val = v - } + a.val = v } func (h *SplitHeader) GetParent() *refs.ObjectID { @@ -453,9 +435,7 @@ func (h *SplitHeader) GetParent() *refs.ObjectID { } func (h *SplitHeader) SetParent(v *refs.ObjectID) { - if h != nil { - h.par = v - } + h.par = v } func (h *SplitHeader) GetPrevious() *refs.ObjectID { @@ -467,9 +447,7 @@ func (h *SplitHeader) GetPrevious() *refs.ObjectID { } func (h *SplitHeader) SetPrevious(v *refs.ObjectID) { - if h != nil { - h.prev = v - } + h.prev = v } func (h *SplitHeader) GetParentSignature() *refs.Signature { @@ -481,9 +459,7 @@ func (h *SplitHeader) GetParentSignature() *refs.Signature { } func (h *SplitHeader) SetParentSignature(v *refs.Signature) { - if h != nil { - h.parSig = v - } + h.parSig = v } func (h *SplitHeader) GetParentHeader() *Header { @@ -495,9 +471,7 @@ func (h *SplitHeader) GetParentHeader() *Header { } func (h *SplitHeader) SetParentHeader(v *Header) { - if h != nil { - h.parHdr = v - } + h.parHdr = v } func (h *SplitHeader) GetChildren() []refs.ObjectID { @@ -509,9 +483,7 @@ func (h *SplitHeader) GetChildren() []refs.ObjectID { } func (h *SplitHeader) SetChildren(v []refs.ObjectID) { - if h != nil { - h.children = v - } + h.children = v } func (h *SplitHeader) GetSplitID() []byte { @@ -523,9 +495,7 @@ func (h *SplitHeader) GetSplitID() []byte { } func (h *SplitHeader) SetSplitID(v []byte) { - if h != nil { - h.splitID = v - } + h.splitID = v } func (h *Header) GetVersion() *refs.Version { @@ -537,9 +507,7 @@ func (h *Header) GetVersion() *refs.Version { } func (h *Header) SetVersion(v *refs.Version) { - if h != nil { - h.version = v - } + h.version = v } func (h *Header) GetContainerID() *refs.ContainerID { @@ -551,9 +519,7 @@ func (h *Header) GetContainerID() *refs.ContainerID { } func (h *Header) SetContainerID(v *refs.ContainerID) { - if h != nil { - h.cid = v - } + h.cid = v } func (h *Header) GetOwnerID() *refs.OwnerID { @@ -565,9 +531,7 @@ func (h *Header) GetOwnerID() *refs.OwnerID { } func (h *Header) SetOwnerID(v *refs.OwnerID) { - if h != nil { - h.ownerID = v - } + h.ownerID = v } func (h *Header) GetCreationEpoch() uint64 { @@ -579,9 +543,7 @@ func (h *Header) GetCreationEpoch() uint64 { } func (h *Header) SetCreationEpoch(v uint64) { - if h != nil { - h.creatEpoch = v - } + h.creatEpoch = v } func (h *Header) GetPayloadLength() uint64 { @@ -593,9 +555,7 @@ func (h *Header) GetPayloadLength() uint64 { } func (h *Header) SetPayloadLength(v uint64) { - if h != nil { - h.payloadLen = v - } + h.payloadLen = v } func (h *Header) GetPayloadHash() *refs.Checksum { @@ -607,9 +567,7 @@ func (h *Header) GetPayloadHash() *refs.Checksum { } func (h *Header) SetPayloadHash(v *refs.Checksum) { - if h != nil { - h.payloadHash = v - } + h.payloadHash = v } func (h *Header) GetObjectType() Type { @@ -621,9 +579,7 @@ func (h *Header) GetObjectType() Type { } func (h *Header) SetObjectType(v Type) { - if h != nil { - h.typ = v - } + h.typ = v } func (h *Header) GetHomomorphicHash() *refs.Checksum { @@ -635,9 +591,7 @@ func (h *Header) GetHomomorphicHash() *refs.Checksum { } func (h *Header) SetHomomorphicHash(v *refs.Checksum) { - if h != nil { - h.homoHash = v - } + h.homoHash = v } func (h *Header) GetSessionToken() *session.Token { @@ -649,9 +603,7 @@ func (h *Header) GetSessionToken() *session.Token { } func (h *Header) SetSessionToken(v *session.Token) { - if h != nil { - h.sessionToken = v - } + h.sessionToken = v } func (h *Header) GetAttributes() []Attribute { @@ -663,9 +615,7 @@ func (h *Header) GetAttributes() []Attribute { } func (h *Header) SetAttributes(v []Attribute) { - if h != nil { - h.attr = v - } + h.attr = v } func (h *Header) GetSplit() *SplitHeader { @@ -677,9 +627,7 @@ func (h *Header) GetSplit() *SplitHeader { } func (h *Header) SetSplit(v *SplitHeader) { - if h != nil { - h.split = v - } + h.split = v } func (h *HeaderWithSignature) GetHeader() *Header { @@ -691,9 +639,7 @@ func (h *HeaderWithSignature) GetHeader() *Header { } func (h *HeaderWithSignature) SetHeader(v *Header) { - if h != nil { - h.header = v - } + h.header = v } func (h *HeaderWithSignature) GetSignature() *refs.Signature { @@ -705,9 +651,7 @@ func (h *HeaderWithSignature) GetSignature() *refs.Signature { } func (h *HeaderWithSignature) SetSignature(v *refs.Signature) { - if h != nil { - h.signature = v - } + h.signature = v } func (h *HeaderWithSignature) getHeaderPart() {} @@ -721,9 +665,7 @@ func (o *Object) GetObjectID() *refs.ObjectID { } func (o *Object) SetObjectID(v *refs.ObjectID) { - if o != nil { - o.objectID = v - } + o.objectID = v } func (o *Object) GetSignature() *refs.Signature { @@ -735,9 +677,7 @@ func (o *Object) GetSignature() *refs.Signature { } func (o *Object) SetSignature(v *refs.Signature) { - if o != nil { - o.idSig = v - } + o.idSig = v } func (o *Object) GetHeader() *Header { @@ -749,9 +689,7 @@ func (o *Object) GetHeader() *Header { } func (o *Object) SetHeader(v *Header) { - if o != nil { - o.header = v - } + o.header = v } func (o *Object) GetPayload() []byte { @@ -763,9 +701,7 @@ func (o *Object) GetPayload() []byte { } func (o *Object) SetPayload(v []byte) { - if o != nil { - o.payload = v - } + o.payload = v } func (s *SplitInfo) GetSplitID() []byte { @@ -777,9 +713,7 @@ func (s *SplitInfo) GetSplitID() []byte { } func (s *SplitInfo) SetSplitID(v []byte) { - if s != nil { - s.splitID = v - } + s.splitID = v } func (s *SplitInfo) GetLastPart() *refs.ObjectID { @@ -791,9 +725,7 @@ func (s *SplitInfo) GetLastPart() *refs.ObjectID { } func (s *SplitInfo) SetLastPart(v *refs.ObjectID) { - if s != nil { - s.lastPart = v - } + s.lastPart = v } func (s *SplitInfo) GetLink() *refs.ObjectID { @@ -805,9 +737,7 @@ func (s *SplitInfo) GetLink() *refs.ObjectID { } func (s *SplitInfo) SetLink(v *refs.ObjectID) { - if s != nil { - s.link = v - } + s.link = v } func (s *SplitInfo) getObjectPart() {} @@ -825,9 +755,7 @@ func (r *GetRequestBody) GetAddress() *refs.Address { } func (r *GetRequestBody) SetAddress(v *refs.Address) { - if r != nil { - r.addr = v - } + r.addr = v } func (r *GetRequestBody) GetRaw() bool { @@ -839,9 +767,7 @@ func (r *GetRequestBody) GetRaw() bool { } func (r *GetRequestBody) SetRaw(v bool) { - if r != nil { - r.raw = v - } + r.raw = v } func (r *GetRequest) GetBody() *GetRequestBody { @@ -853,9 +779,7 @@ func (r *GetRequest) GetBody() *GetRequestBody { } func (r *GetRequest) SetBody(v *GetRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetObjectPartInit) GetObjectID() *refs.ObjectID { @@ -867,9 +791,7 @@ func (r *GetObjectPartInit) GetObjectID() *refs.ObjectID { } func (r *GetObjectPartInit) SetObjectID(v *refs.ObjectID) { - if r != nil { - r.id = v - } + r.id = v } func (r *GetObjectPartInit) GetSignature() *refs.Signature { @@ -881,9 +803,7 @@ func (r *GetObjectPartInit) GetSignature() *refs.Signature { } func (r *GetObjectPartInit) SetSignature(v *refs.Signature) { - if r != nil { - r.sig = v - } + r.sig = v } func (r *GetObjectPartInit) GetHeader() *Header { @@ -895,9 +815,7 @@ func (r *GetObjectPartInit) GetHeader() *Header { } func (r *GetObjectPartInit) SetHeader(v *Header) { - if r != nil { - r.hdr = v - } + r.hdr = v } func (r *GetObjectPartInit) getObjectPart() {} @@ -911,9 +829,7 @@ func (r *GetObjectPartChunk) GetChunk() []byte { } func (r *GetObjectPartChunk) SetChunk(v []byte) { - if r != nil { - r.chunk = v - } + r.chunk = v } func (r *GetObjectPartChunk) getObjectPart() {} @@ -927,9 +843,7 @@ func (r *GetResponseBody) GetObjectPart() GetObjectPart { } func (r *GetResponseBody) SetObjectPart(v GetObjectPart) { - if r != nil { - r.objPart = v - } + r.objPart = v } func (r *GetResponse) GetBody() *GetResponseBody { @@ -941,9 +855,7 @@ func (r *GetResponse) GetBody() *GetResponseBody { } func (r *GetResponse) SetBody(v *GetResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *PutObjectPartInit) GetObjectID() *refs.ObjectID { @@ -955,9 +867,7 @@ func (r *PutObjectPartInit) GetObjectID() *refs.ObjectID { } func (r *PutObjectPartInit) SetObjectID(v *refs.ObjectID) { - if r != nil { - r.id = v - } + r.id = v } func (r *PutObjectPartInit) GetSignature() *refs.Signature { @@ -969,9 +879,7 @@ func (r *PutObjectPartInit) GetSignature() *refs.Signature { } func (r *PutObjectPartInit) SetSignature(v *refs.Signature) { - if r != nil { - r.sig = v - } + r.sig = v } func (r *PutObjectPartInit) GetHeader() *Header { @@ -983,9 +891,7 @@ func (r *PutObjectPartInit) GetHeader() *Header { } func (r *PutObjectPartInit) SetHeader(v *Header) { - if r != nil { - r.hdr = v - } + r.hdr = v } func (r *PutObjectPartInit) GetCopiesNumber() uint32 { @@ -997,9 +903,7 @@ func (r *PutObjectPartInit) GetCopiesNumber() uint32 { } func (r *PutObjectPartInit) SetCopiesNumber(v uint32) { - if r != nil { - r.copyNum = v - } + r.copyNum = v } func (r *PutObjectPartInit) putObjectPart() {} @@ -1013,9 +917,7 @@ func (r *PutObjectPartChunk) GetChunk() []byte { } func (r *PutObjectPartChunk) SetChunk(v []byte) { - if r != nil { - r.chunk = v - } + r.chunk = v } func (r *PutObjectPartChunk) putObjectPart() {} @@ -1029,9 +931,7 @@ func (r *PutRequestBody) GetObjectPart() PutObjectPart { } func (r *PutRequestBody) SetObjectPart(v PutObjectPart) { - if r != nil { - r.objPart = v - } + r.objPart = v } func (r *PutRequest) GetBody() *PutRequestBody { @@ -1043,9 +943,7 @@ func (r *PutRequest) GetBody() *PutRequestBody { } func (r *PutRequest) SetBody(v *PutRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *PutResponseBody) GetObjectID() *refs.ObjectID { @@ -1057,9 +955,7 @@ func (r *PutResponseBody) GetObjectID() *refs.ObjectID { } func (r *PutResponseBody) SetObjectID(v *refs.ObjectID) { - if r != nil { - r.id = v - } + r.id = v } func (r *PutResponse) GetBody() *PutResponseBody { @@ -1071,9 +967,7 @@ func (r *PutResponse) GetBody() *PutResponseBody { } func (r *PutResponse) SetBody(v *PutResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *DeleteRequestBody) GetAddress() *refs.Address { @@ -1085,9 +979,7 @@ func (r *DeleteRequestBody) GetAddress() *refs.Address { } func (r *DeleteRequestBody) SetAddress(v *refs.Address) { - if r != nil { - r.addr = v - } + r.addr = v } func (r *DeleteRequest) GetBody() *DeleteRequestBody { @@ -1099,9 +991,7 @@ func (r *DeleteRequest) GetBody() *DeleteRequestBody { } func (r *DeleteRequest) SetBody(v *DeleteRequestBody) { - if r != nil { - r.body = v - } + r.body = v } // GetTombstone returns tombstone address. @@ -1115,9 +1005,7 @@ func (r *DeleteResponseBody) GetTombstone() *refs.Address { // SetTombstone sets tombstone address. func (r *DeleteResponseBody) SetTombstone(v *refs.Address) { - if r != nil { - r.tombstone = v - } + r.tombstone = v } func (r *DeleteResponse) GetBody() *DeleteResponseBody { @@ -1129,9 +1017,7 @@ func (r *DeleteResponse) GetBody() *DeleteResponseBody { } func (r *DeleteResponse) SetBody(v *DeleteResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *HeadRequestBody) GetAddress() *refs.Address { @@ -1143,9 +1029,7 @@ func (r *HeadRequestBody) GetAddress() *refs.Address { } func (r *HeadRequestBody) SetAddress(v *refs.Address) { - if r != nil { - r.addr = v - } + r.addr = v } func (r *HeadRequestBody) GetMainOnly() bool { @@ -1157,9 +1041,7 @@ func (r *HeadRequestBody) GetMainOnly() bool { } func (r *HeadRequestBody) SetMainOnly(v bool) { - if r != nil { - r.mainOnly = v - } + r.mainOnly = v } func (r *HeadRequestBody) GetRaw() bool { @@ -1171,9 +1053,7 @@ func (r *HeadRequestBody) GetRaw() bool { } func (r *HeadRequestBody) SetRaw(v bool) { - if r != nil { - r.raw = v - } + r.raw = v } func (r *HeadRequest) GetBody() *HeadRequestBody { @@ -1185,9 +1065,7 @@ func (r *HeadRequest) GetBody() *HeadRequestBody { } func (r *HeadRequest) SetBody(v *HeadRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *HeadResponseBody) GetHeaderPart() GetHeaderPart { @@ -1199,9 +1077,7 @@ func (r *HeadResponseBody) GetHeaderPart() GetHeaderPart { } func (r *HeadResponseBody) SetHeaderPart(v GetHeaderPart) { - if r != nil { - r.hdrPart = v - } + r.hdrPart = v } func (r *HeadResponse) GetBody() *HeadResponseBody { @@ -1213,9 +1089,7 @@ func (r *HeadResponse) GetBody() *HeadResponseBody { } func (r *HeadResponse) SetBody(v *HeadResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (f *SearchFilter) GetMatchType() MatchType { @@ -1227,9 +1101,7 @@ func (f *SearchFilter) GetMatchType() MatchType { } func (f *SearchFilter) SetMatchType(v MatchType) { - if f != nil { - f.matchType = v - } + f.matchType = v } func (f *SearchFilter) GetKey() string { @@ -1241,9 +1113,7 @@ func (f *SearchFilter) GetKey() string { } func (f *SearchFilter) SetKey(v string) { - if f != nil { - f.key = v - } + f.key = v } func (f *SearchFilter) GetValue() string { @@ -1255,9 +1125,7 @@ func (f *SearchFilter) GetValue() string { } func (f *SearchFilter) SetValue(v string) { - if f != nil { - f.val = v - } + f.val = v } func (r *SearchRequestBody) GetContainerID() *refs.ContainerID { @@ -1269,9 +1137,7 @@ func (r *SearchRequestBody) GetContainerID() *refs.ContainerID { } func (r *SearchRequestBody) SetContainerID(v *refs.ContainerID) { - if r != nil { - r.cid = v - } + r.cid = v } func (r *SearchRequestBody) GetVersion() uint32 { @@ -1283,9 +1149,7 @@ func (r *SearchRequestBody) GetVersion() uint32 { } func (r *SearchRequestBody) SetVersion(v uint32) { - if r != nil { - r.version = v - } + r.version = v } func (r *SearchRequestBody) GetFilters() []SearchFilter { @@ -1297,9 +1161,7 @@ func (r *SearchRequestBody) GetFilters() []SearchFilter { } func (r *SearchRequestBody) SetFilters(v []SearchFilter) { - if r != nil { - r.filters = v - } + r.filters = v } func (r *SearchRequest) GetBody() *SearchRequestBody { @@ -1311,9 +1173,7 @@ func (r *SearchRequest) GetBody() *SearchRequestBody { } func (r *SearchRequest) SetBody(v *SearchRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *SearchResponseBody) GetIDList() []refs.ObjectID { @@ -1325,9 +1185,7 @@ func (r *SearchResponseBody) GetIDList() []refs.ObjectID { } func (r *SearchResponseBody) SetIDList(v []refs.ObjectID) { - if r != nil { - r.idList = v - } + r.idList = v } func (r *SearchResponse) GetBody() *SearchResponseBody { @@ -1339,9 +1197,7 @@ func (r *SearchResponse) GetBody() *SearchResponseBody { } func (r *SearchResponse) SetBody(v *SearchResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *Range) GetOffset() uint64 { @@ -1353,9 +1209,7 @@ func (r *Range) GetOffset() uint64 { } func (r *Range) SetOffset(v uint64) { - if r != nil { - r.off = v - } + r.off = v } func (r *Range) GetLength() uint64 { @@ -1367,9 +1221,7 @@ func (r *Range) GetLength() uint64 { } func (r *Range) SetLength(v uint64) { - if r != nil { - r.len = v - } + r.len = v } func (r *GetRangeRequestBody) GetAddress() *refs.Address { @@ -1381,9 +1233,7 @@ func (r *GetRangeRequestBody) GetAddress() *refs.Address { } func (r *GetRangeRequestBody) SetAddress(v *refs.Address) { - if r != nil { - r.addr = v - } + r.addr = v } func (r *GetRangeRequestBody) GetRange() *Range { @@ -1395,9 +1245,7 @@ func (r *GetRangeRequestBody) GetRange() *Range { } func (r *GetRangeRequestBody) SetRange(v *Range) { - if r != nil { - r.rng = v - } + r.rng = v } func (r *GetRangeRequestBody) GetRaw() bool { @@ -1409,9 +1257,7 @@ func (r *GetRangeRequestBody) GetRaw() bool { } func (r *GetRangeRequestBody) SetRaw(v bool) { - if r != nil { - r.raw = v - } + r.raw = v } func (r *GetRangeRequest) GetBody() *GetRangeRequestBody { @@ -1423,9 +1269,7 @@ func (r *GetRangeRequest) GetBody() *GetRangeRequestBody { } func (r *GetRangeRequest) SetBody(v *GetRangeRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetRangePartChunk) GetChunk() []byte { @@ -1437,9 +1281,7 @@ func (r *GetRangePartChunk) GetChunk() []byte { } func (r *GetRangePartChunk) SetChunk(v []byte) { - if r != nil { - r.chunk = v - } + r.chunk = v } func (r *GetRangePartChunk) getRangePart() {} @@ -1453,9 +1295,7 @@ func (r *GetRangeResponseBody) GetRangePart() GetRangePart { } func (r *GetRangeResponseBody) SetRangePart(v GetRangePart) { - if r != nil { - r.rngPart = v - } + r.rngPart = v } func (r *GetRangeResponse) GetBody() *GetRangeResponseBody { @@ -1467,9 +1307,7 @@ func (r *GetRangeResponse) GetBody() *GetRangeResponseBody { } func (r *GetRangeResponse) SetBody(v *GetRangeResponseBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetRangeHashRequestBody) GetAddress() *refs.Address { @@ -1481,9 +1319,7 @@ func (r *GetRangeHashRequestBody) GetAddress() *refs.Address { } func (r *GetRangeHashRequestBody) SetAddress(v *refs.Address) { - if r != nil { - r.addr = v - } + r.addr = v } func (r *GetRangeHashRequestBody) GetRanges() []Range { @@ -1495,9 +1331,7 @@ func (r *GetRangeHashRequestBody) GetRanges() []Range { } func (r *GetRangeHashRequestBody) SetRanges(v []Range) { - if r != nil { - r.rngs = v - } + r.rngs = v } func (r *GetRangeHashRequestBody) GetSalt() []byte { @@ -1509,9 +1343,7 @@ func (r *GetRangeHashRequestBody) GetSalt() []byte { } func (r *GetRangeHashRequestBody) SetSalt(v []byte) { - if r != nil { - r.salt = v - } + r.salt = v } func (r *GetRangeHashRequestBody) GetType() refs.ChecksumType { @@ -1523,9 +1355,7 @@ func (r *GetRangeHashRequestBody) GetType() refs.ChecksumType { } func (r *GetRangeHashRequestBody) SetType(v refs.ChecksumType) { - if r != nil { - r.typ = v - } + r.typ = v } func (r *GetRangeHashRequest) GetBody() *GetRangeHashRequestBody { @@ -1537,9 +1367,7 @@ func (r *GetRangeHashRequest) GetBody() *GetRangeHashRequestBody { } func (r *GetRangeHashRequest) SetBody(v *GetRangeHashRequestBody) { - if r != nil { - r.body = v - } + r.body = v } func (r *GetRangeHashResponseBody) GetType() refs.ChecksumType { @@ -1551,9 +1379,7 @@ func (r *GetRangeHashResponseBody) GetType() refs.ChecksumType { } func (r *GetRangeHashResponseBody) SetType(v refs.ChecksumType) { - if r != nil { - r.typ = v - } + r.typ = v } func (r *GetRangeHashResponseBody) GetHashList() [][]byte { @@ -1565,9 +1391,7 @@ func (r *GetRangeHashResponseBody) GetHashList() [][]byte { } func (r *GetRangeHashResponseBody) SetHashList(v [][]byte) { - if r != nil { - r.hashList = v - } + r.hashList = v } func (r *GetRangeHashResponse) GetBody() *GetRangeHashResponseBody { @@ -1579,7 +1403,5 @@ func (r *GetRangeHashResponse) GetBody() *GetRangeHashResponseBody { } func (r *GetRangeHashResponse) SetBody(v *GetRangeHashResponseBody) { - if r != nil { - r.body = v - } + r.body = v } diff --git a/refs/grpc/types.go b/refs/grpc/types.go index e191656..0cf7368 100644 --- a/refs/grpc/types.go +++ b/refs/grpc/types.go @@ -2,100 +2,72 @@ package refs // SetValue sets container identifier in a binary format. func (x *ContainerID) SetValue(v []byte) { - if x != nil { - x.Value = v - } + x.Value = v } // SetValue sets object identifier in a binary format. func (x *ObjectID) SetValue(v []byte) { - if x != nil { - x.Value = v - } + x.Value = v } // SetValue sets owner identifier in a binary format. func (x *OwnerID) SetValue(v []byte) { - if x != nil { - x.Value = v - } + x.Value = v } // SetContainerId sets container identifier of the address. func (x *Address) SetContainerId(v *ContainerID) { - if x != nil { - x.ContainerId = v - } + x.ContainerId = v } // SetObjectId sets object identifier of the address. func (x *Address) SetObjectId(v *ObjectID) { - if x != nil { - x.ObjectId = v - } + x.ObjectId = v } // SetChecksumType in generic checksum structure. func (x *Checksum) SetChecksumType(v ChecksumType) { - if x != nil { - x.Type = v - } + x.Type = v } // SetSum in generic checksum structure. func (x *Checksum) SetSum(v []byte) { - if x != nil { - x.Sum = v - } + x.Sum = v } // SetMajor sets major version number. func (x *Version) SetMajor(v uint32) { - if x != nil { - x.Major = v - } + x.Major = v } // SetMinor sets minor version number. func (x *Version) SetMinor(v uint32) { - if x != nil { - x.Minor = v - } + x.Minor = v } // SetKey sets public key in a binary format. func (x *Signature) SetKey(v []byte) { - if x != nil { - x.Key = v - } + x.Key = v } // SetSign sets signature. func (x *Signature) SetSign(v []byte) { - if x != nil { - x.Sign = v - } + x.Sign = v } // SetScheme sets signature scheme. func (x *Signature) SetScheme(s SignatureScheme) { - if x != nil { - x.Scheme = s - } + x.Scheme = s } // SetKey sets public key in a binary format. func (x *SignatureRFC6979) SetKey(v []byte) { - if x != nil { - x.Key = v - } + x.Key = v } // SetSign sets signature. func (x *SignatureRFC6979) SetSign(v []byte) { - if x != nil { - x.Sign = v - } + x.Sign = v } // FromString parses SignatureScheme from a string representation, @@ -126,7 +98,5 @@ func (x *ChecksumType) FromString(s string) bool { // SetValue sets subnet identifier in a base-10 integer format. func (x *SubnetID) SetValue(v uint32) { - if x != nil { - x.Value = v - } + x.Value = v } diff --git a/refs/types.go b/refs/types.go index 7d89881..025761d 100644 --- a/refs/types.go +++ b/refs/types.go @@ -67,9 +67,7 @@ func (o *OwnerID) GetValue() []byte { } func (o *OwnerID) SetValue(v []byte) { - if o != nil { - o.val = v - } + o.val = v } func (c *ContainerID) GetValue() []byte { @@ -81,9 +79,7 @@ func (c *ContainerID) GetValue() []byte { } func (c *ContainerID) SetValue(v []byte) { - if c != nil { - c.val = v - } + c.val = v } func (o *ObjectID) GetValue() []byte { @@ -95,9 +91,7 @@ func (o *ObjectID) GetValue() []byte { } func (o *ObjectID) SetValue(v []byte) { - if o != nil { - o.val = v - } + o.val = v } func (a *Address) GetContainerID() *ContainerID { @@ -109,9 +103,7 @@ func (a *Address) GetContainerID() *ContainerID { } func (a *Address) SetContainerID(v *ContainerID) { - if a != nil { - a.cid = v - } + a.cid = v } func (a *Address) GetObjectID() *ObjectID { @@ -123,9 +115,7 @@ func (a *Address) GetObjectID() *ObjectID { } func (a *Address) SetObjectID(v *ObjectID) { - if a != nil { - a.oid = v - } + a.oid = v } func (c *Checksum) GetType() ChecksumType { @@ -137,9 +127,7 @@ func (c *Checksum) GetType() ChecksumType { } func (c *Checksum) SetType(v ChecksumType) { - if c != nil { - c.typ = v - } + c.typ = v } func (c *Checksum) GetSum() []byte { @@ -151,9 +139,7 @@ func (c *Checksum) GetSum() []byte { } func (c *Checksum) SetSum(v []byte) { - if c != nil { - c.sum = v - } + c.sum = v } func (s *Signature) GetKey() []byte { @@ -165,9 +151,7 @@ func (s *Signature) GetKey() []byte { } func (s *Signature) SetKey(v []byte) { - if s != nil { - s.key = v - } + s.key = v } func (s *Signature) GetSign() []byte { @@ -179,9 +163,7 @@ func (s *Signature) GetSign() []byte { } func (s *Signature) SetSign(v []byte) { - if s != nil { - s.sign = v - } + s.sign = v } func (s *Signature) GetScheme() SignatureScheme { @@ -192,15 +174,11 @@ func (s *Signature) GetScheme() SignatureScheme { } func (s *Signature) SetScheme(scheme SignatureScheme) { - if s != nil { - s.scheme = scheme - } + s.scheme = scheme } func (s *SubnetID) SetValue(id uint32) { - if s != nil { - s.value = id - } + s.value = id } func (s *SubnetID) GetValue() uint32 { @@ -258,9 +236,7 @@ func (v *Version) GetMajor() uint32 { } func (v *Version) SetMajor(val uint32) { - if v != nil { - v.major = val - } + v.major = val } func (v *Version) GetMinor() uint32 { @@ -272,7 +248,5 @@ func (v *Version) GetMinor() uint32 { } func (v *Version) SetMinor(val uint32) { - if v != nil { - v.minor = val - } + v.minor = val } diff --git a/reputation/grpc/service.go b/reputation/grpc/service.go index b48a275..519c2df 100644 --- a/reputation/grpc/service.go +++ b/reputation/grpc/service.go @@ -6,119 +6,85 @@ import ( // SetEpoch sets epoch in which the trust was assessed. func (x *AnnounceLocalTrustRequest_Body) SetEpoch(v uint64) { - if x != nil { - x.Epoch = v - } + x.Epoch = v } // SetTrusts sets list of normalized trust values. func (x *AnnounceLocalTrustRequest_Body) SetTrusts(v []*Trust) { - if x != nil { - x.Trusts = v - } + x.Trusts = v } // SetBody sets body of the request. func (x *AnnounceLocalTrustRequest) SetBody(v *AnnounceLocalTrustRequest_Body) { - if x != nil { - x.Body = v - } + x.Body = v } // SetMetaHeader sets meta header of the request. func (x *AnnounceLocalTrustRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if x != nil { - x.MetaHeader = v - } + x.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (x *AnnounceLocalTrustRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if x != nil { - x.VerifyHeader = v - } + x.VerifyHeader = v } // SetBody sets body of the response. func (x *AnnounceLocalTrustResponse) SetBody(v *AnnounceLocalTrustResponse_Body) { - if x != nil { - x.Body = v - } + x.Body = v } // SetMetaHeader sets meta header of the response. func (x *AnnounceLocalTrustResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if x != nil { - x.MetaHeader = v - } + x.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (x *AnnounceLocalTrustResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if x != nil { - x.VerifyHeader = v - } + x.VerifyHeader = v } // SetEpoch sets epoch in which the intermediate trust was assessed. func (x *AnnounceIntermediateResultRequest_Body) SetEpoch(v uint64) { - if x != nil { - x.Epoch = v - } + x.Epoch = v } // SetIteration sets sequence number of the iteration. func (x *AnnounceIntermediateResultRequest_Body) SetIteration(v uint32) { - if x != nil { - x.Iteration = v - } + x.Iteration = v } // SetTrust sets current global trust value. func (x *AnnounceIntermediateResultRequest_Body) SetTrust(v *PeerToPeerTrust) { - if x != nil { - x.Trust = v - } + x.Trust = v } // SetBody sets body of the request. func (x *AnnounceIntermediateResultRequest) SetBody(v *AnnounceIntermediateResultRequest_Body) { - if x != nil { - x.Body = v - } + x.Body = v } // SetMetaHeader sets meta header of the request. func (x *AnnounceIntermediateResultRequest) SetMetaHeader(v *session.RequestMetaHeader) { - if x != nil { - x.MetaHeader = v - } + x.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (x *AnnounceIntermediateResultRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { - if x != nil { - x.VerifyHeader = v - } + x.VerifyHeader = v } // SetBody sets body of the response. func (x *AnnounceIntermediateResultResponse) SetBody(v *AnnounceIntermediateResultResponse_Body) { - if x != nil { - x.Body = v - } + x.Body = v } // SetMetaHeader sets meta header of the response. func (x *AnnounceIntermediateResultResponse) SetMetaHeader(v *session.ResponseMetaHeader) { - if x != nil { - x.MetaHeader = v - } + x.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (x *AnnounceIntermediateResultResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { - if x != nil { - x.VerifyHeader = v - } + x.VerifyHeader = v } diff --git a/reputation/grpc/types.go b/reputation/grpc/types.go index 86fb05f..14848d3 100644 --- a/reputation/grpc/types.go +++ b/reputation/grpc/types.go @@ -6,70 +6,50 @@ import ( // SetPublicKey sets binary public key of ID. func (x *PeerID) SetPublicKey(v []byte) { - if x != nil { - x.PublicKey = v - } + x.PublicKey = v } // SetPeer sets trusted peer's ID. func (x *Trust) SetPeer(v *PeerID) { - if x != nil { - x.Peer = v - } + x.Peer = v } // SetValue sets trust value. func (x *Trust) SetValue(v float64) { - if x != nil { - x.Value = v - } + x.Value = v } // SetTrustingPeer sets trusting peer ID. func (x *PeerToPeerTrust) SetTrustingPeer(v *PeerID) { - if x != nil { - x.TrustingPeer = v - } + x.TrustingPeer = v } // SetTrust sets trust value of trusting peer to the trusted one. func (x *PeerToPeerTrust) SetTrust(v *Trust) { - if x != nil { - x.Trust = v - } + x.Trust = v } // SetManager sets manager ID. func (x *GlobalTrust_Body) SetManager(v *PeerID) { - if x != nil { - x.Manager = v - } + x.Manager = v } // SetTrust sets global trust value. func (x *GlobalTrust_Body) SetTrust(v *Trust) { - if x != nil { - x.Trust = v - } + x.Trust = v } // SetVersion sets message format version. func (x *GlobalTrust) SetVersion(v *refs.Version) { - if x != nil { - x.Version = v - } + x.Version = v } // SetBody sets message body. func (x *GlobalTrust) SetBody(v *GlobalTrust_Body) { - if x != nil { - x.Body = v - } + x.Body = v } // SetSignature sets body signature. func (x *GlobalTrust) SetSignature(v *refs.Signature) { - if x != nil { - x.Signature = v - } + x.Signature = v } diff --git a/reputation/types.go b/reputation/types.go index 5ccb203..f058efc 100644 --- a/reputation/types.go +++ b/reputation/types.go @@ -22,9 +22,7 @@ func (x *PeerID) GetPublicKey() []byte { // SetPublicKey sets peer's binary public key of ID. func (x *PeerID) SetPublicKey(v []byte) { - if x != nil { - x.publicKey = v - } + x.publicKey = v } // Trust represents reputation.Trust message @@ -46,9 +44,7 @@ func (x *Trust) GetPeer() *PeerID { // SetPeer sets trusted peer's ID. func (x *Trust) SetPeer(v *PeerID) { - if x != nil { - x.peer = v - } + x.peer = v } // GetValue returns trust value. @@ -62,9 +58,7 @@ func (x *Trust) GetValue() float64 { // SetValue sets trust value. func (x *Trust) SetValue(v float64) { - if x != nil { - x.val = v - } + x.val = v } // PeerToPeerTrust represents reputation.PeerToPeerTrust message @@ -86,9 +80,7 @@ func (x *PeerToPeerTrust) GetTrustingPeer() *PeerID { // SetTrustingPeer sets trusting peer ID. func (x *PeerToPeerTrust) SetTrustingPeer(v *PeerID) { - if x != nil { - x.trusting = v - } + x.trusting = v } // GetTrust returns trust value of trusting peer to the trusted one. @@ -102,9 +94,7 @@ func (x *PeerToPeerTrust) GetTrust() *Trust { // SetTrust sets trust value of trusting peer to the trusted one. func (x *PeerToPeerTrust) SetTrust(v *Trust) { - if x != nil { - x.trust = v - } + x.trust = v } // GlobalTrustBody represents reputation.GlobalTrust.Body message @@ -126,9 +116,7 @@ func (x *GlobalTrustBody) GetManager() *PeerID { // SetManager sets node manager ID. func (x *GlobalTrustBody) SetManager(v *PeerID) { - if x != nil { - x.manager = v - } + x.manager = v } // GetTrust returns global trust value. @@ -142,9 +130,7 @@ func (x *GlobalTrustBody) GetTrust() *Trust { // SetTrust sets global trust value. func (x *GlobalTrustBody) SetTrust(v *Trust) { - if x != nil { - x.trust = v - } + x.trust = v } // GlobalTrust represents reputation.GlobalTrust message @@ -168,9 +154,7 @@ func (x *GlobalTrust) GetVersion() *refs.Version { // SetVersion sets message format version. func (x *GlobalTrust) SetVersion(v *refs.Version) { - if x != nil { - x.version = v - } + x.version = v } // GetBody returns message body. @@ -184,9 +168,7 @@ func (x *GlobalTrust) GetBody() *GlobalTrustBody { // SetBody sets message body. func (x *GlobalTrust) SetBody(v *GlobalTrustBody) { - if x != nil { - x.body = v - } + x.body = v } // GetSignature returns body signature. @@ -200,9 +182,7 @@ func (x *GlobalTrust) GetSignature() *refs.Signature { // SetSignature sets body signature. func (x *GlobalTrust) SetSignature(v *refs.Signature) { - if x != nil { - x.sig = v - } + x.sig = v } // AnnounceLocalTrustRequestBody is a structure of AnnounceLocalTrust request body. @@ -223,9 +203,7 @@ func (x *AnnounceLocalTrustRequestBody) GetEpoch() uint64 { // SetEpoch sets epoch in which the trust was assessed. func (x *AnnounceLocalTrustRequestBody) SetEpoch(v uint64) { - if x != nil { - x.epoch = v - } + x.epoch = v } // GetTrusts returns list of normalized trust values. @@ -239,9 +217,7 @@ func (x *AnnounceLocalTrustRequestBody) GetTrusts() []Trust { // SetTrusts sets list of normalized trust values. func (x *AnnounceLocalTrustRequestBody) SetTrusts(v []Trust) { - if x != nil { - x.trusts = v - } + x.trusts = v } // AnnounceLocalTrustResponseBody is a structure of AnnounceLocalTrust response body. @@ -266,9 +242,7 @@ func (x *AnnounceLocalTrustRequest) GetBody() *AnnounceLocalTrustRequestBody { // SetBody sets request body. func (x *AnnounceLocalTrustRequest) SetBody(v *AnnounceLocalTrustRequestBody) { - if x != nil { - x.body = v - } + x.body = v } // AnnounceLocalTrustResponse represents reputation.AnnounceLocalTrustResponse @@ -290,9 +264,7 @@ func (x *AnnounceLocalTrustResponse) GetBody() *AnnounceLocalTrustResponseBody { // SetBody sets response body. func (x *AnnounceLocalTrustResponse) SetBody(v *AnnounceLocalTrustResponseBody) { - if x != nil { - x.body = v - } + x.body = v } // AnnounceIntermediateResultRequestBody is a structure of AnnounceIntermediateResult request body. @@ -315,9 +287,7 @@ func (x *AnnounceIntermediateResultRequestBody) GetEpoch() uint64 { // SetEpoch sets epoch number in which the intermediate trust was assessed. func (x *AnnounceIntermediateResultRequestBody) SetEpoch(v uint64) { - if x != nil { - x.epoch = v - } + x.epoch = v } // GetIteration returns sequence number of the iteration. @@ -331,9 +301,7 @@ func (x *AnnounceIntermediateResultRequestBody) GetIteration() uint32 { // SetIteration sets sequence number of the iteration. func (x *AnnounceIntermediateResultRequestBody) SetIteration(v uint32) { - if x != nil { - x.iter = v - } + x.iter = v } // GetTrust returns current global trust value. @@ -347,9 +315,7 @@ func (x *AnnounceIntermediateResultRequestBody) GetTrust() *PeerToPeerTrust { // SetTrust sets current global trust value. func (x *AnnounceIntermediateResultRequestBody) SetTrust(v *PeerToPeerTrust) { - if x != nil { - x.trust = v - } + x.trust = v } // AnnounceIntermediateResultResponseBody is a structure of AnnounceIntermediateResult response body. @@ -374,9 +340,7 @@ func (x *AnnounceIntermediateResultRequest) GetBody() *AnnounceIntermediateResul // SetBody sets request body. func (x *AnnounceIntermediateResultRequest) SetBody(v *AnnounceIntermediateResultRequestBody) { - if x != nil { - x.body = v - } + x.body = v } // AnnounceIntermediateResultResponse represents reputation.AnnounceIntermediateResultResponse @@ -398,7 +362,5 @@ func (x *AnnounceIntermediateResultResponse) GetBody() *AnnounceIntermediateResu // SetBody sets response body. func (x *AnnounceIntermediateResultResponse) SetBody(v *AnnounceIntermediateResultResponseBody) { - if x != nil { - x.body = v - } + x.body = v } diff --git a/session/grpc/service.go b/session/grpc/service.go index caaf7d9..14348e4 100644 --- a/session/grpc/service.go +++ b/session/grpc/service.go @@ -6,70 +6,50 @@ import ( // SetOwnerId sets identifier of the session initiator. func (m *CreateRequest_Body) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetExpiration sets lifetime of the session. func (m *CreateRequest_Body) SetExpiration(v uint64) { - if m != nil { - m.Expiration = v - } + m.Expiration = v } // SetBody sets body of the request. func (m *CreateRequest) SetBody(v *CreateRequest_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the request. func (m *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the request. func (m *CreateRequest) SetVerifyHeader(v *RequestVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } // SetId sets identifier of the session token. func (m *CreateResponse_Body) SetId(v []byte) { - if m != nil { - m.Id = v - } + m.Id = v } // SetSessionKey sets session public key in a binary format. func (m *CreateResponse_Body) SetSessionKey(v []byte) { - if m != nil { - m.SessionKey = v - } + m.SessionKey = v } // SetBody sets body of the response. func (m *CreateResponse) SetBody(v *CreateResponse_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetMetaHeader sets meta header of the response. func (m *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { - if m != nil { - m.MetaHeader = v - } + m.MetaHeader = v } // SetVerifyHeader sets verification header of the response. func (m *CreateResponse) SetVerifyHeader(v *ResponseVerificationHeader) { - if m != nil { - m.VerifyHeader = v - } + m.VerifyHeader = v } diff --git a/session/grpc/types.go b/session/grpc/types.go index 484203d..64133a8 100644 --- a/session/grpc/types.go +++ b/session/grpc/types.go @@ -8,181 +8,131 @@ import ( // SetKey sets key to the X-Header. func (m *XHeader) SetKey(v string) { - if m != nil { - m.Key = v - } + m.Key = v } // SetValue sets value of the X-Header. func (m *XHeader) SetValue(v string) { - if m != nil { - m.Value = v - } + m.Value = v } // SetExp sets epoch number of the token expiration. func (m *SessionToken_Body_TokenLifetime) SetExp(v uint64) { - if m != nil { - m.Exp = v - } + m.Exp = v } // SetNbf sets starting epoch number of the token. func (m *SessionToken_Body_TokenLifetime) SetNbf(v uint64) { - if m != nil { - m.Nbf = v - } + m.Nbf = v } // SetIat sets the number of the epoch in which the token was issued. func (m *SessionToken_Body_TokenLifetime) SetIat(v uint64) { - if m != nil { - m.Iat = v - } + m.Iat = v } // SetId sets identifier of the session token. func (m *SessionToken_Body) SetId(v []byte) { - if m != nil { - m.Id = v - } + m.Id = v } // SetOwnerId sets identifier of the session token owner. func (m *SessionToken_Body) SetOwnerId(v *refs.OwnerID) { - if m != nil { - m.OwnerId = v - } + m.OwnerId = v } // SetLifetime sets lifetime of the session token. func (m *SessionToken_Body) SetLifetime(v *SessionToken_Body_TokenLifetime) { - if m != nil { - m.Lifetime = v - } + m.Lifetime = v } // SetSessionKey sets public session key in a binary format. func (m *SessionToken_Body) SetSessionKey(v []byte) { - if m != nil { - m.SessionKey = v - } + m.SessionKey = v } // SetObjectAddressContext sets object context of the session token. func (m *SessionToken_Body) SetObjectSessionContext(v *ObjectSessionContext) { - if m != nil { - m.Context = &SessionToken_Body_Object{ - Object: v, - } + m.Context = &SessionToken_Body_Object{ + Object: v, } } // SetContainerSessionContext sets container context of the session token. func (m *SessionToken_Body) SetContainerSessionContext(v *ContainerSessionContext) { - if m != nil { - m.Context = &SessionToken_Body_Container{ - Container: v, - } + m.Context = &SessionToken_Body_Container{ + Container: v, } } // SetAddress sets address of the object related to the session. func (m *ObjectSessionContext) SetAddress(v *refs.Address) { - if m != nil { - m.Address = v - } + m.Address = v } // SetVerb sets type of request for which the token is issued. func (m *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) { - if m != nil { - m.Verb = v - } + m.Verb = v } // SetVerb sets type of request for which the token is issued. func (x *ContainerSessionContext) SetVerb(v ContainerSessionContext_Verb) { - if x != nil { - x.Verb = v - } + x.Verb = v } // SetWildcard sets wildcard flag of the container session. func (x *ContainerSessionContext) SetWildcard(v bool) { - if x != nil { - x.Wildcard = v - } + x.Wildcard = v } // SetContainerId sets identifier of the container related to the session. func (x *ContainerSessionContext) SetContainerId(v *refs.ContainerID) { - if x != nil { - x.ContainerId = v - } + x.ContainerId = v } // SetBody sets session token body. func (m *SessionToken) SetBody(v *SessionToken_Body) { - if m != nil { - m.Body = v - } + m.Body = v } // SetSignature sets session token signature. func (m *SessionToken) SetSignature(v *refs.Signature) { - if m != nil { - m.Signature = v - } + m.Signature = v } // SetVersion sets client protocol version. func (m *RequestMetaHeader) SetVersion(v *refs.Version) { - if m != nil { - m.Version = v - } + m.Version = v } // SetEpoch sets client local epoch. func (m *RequestMetaHeader) SetEpoch(v uint64) { - if m != nil { - m.Epoch = v - } + m.Epoch = v } // SetTtl sets request TTL. func (m *RequestMetaHeader) SetTtl(v uint32) { - if m != nil { - m.Ttl = v - } + m.Ttl = v } // SetXHeaders sets request X-Headers. func (m *RequestMetaHeader) SetXHeaders(v []*XHeader) { - if m != nil { - m.XHeaders = v - } + m.XHeaders = v } // SetSessionToken sets session token of the request. func (m *RequestMetaHeader) SetSessionToken(v *SessionToken) { - if m != nil { - m.SessionToken = v - } + m.SessionToken = v } // SetBearerToken sets bearer token of the request. func (m *RequestMetaHeader) SetBearerToken(v *acl.BearerToken) { - if m != nil { - m.BearerToken = v - } + m.BearerToken = v } // SetOrigin sets origin request meta header. func (m *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { - if m != nil { - m.Origin = v - } + m.Origin = v } // GetNetworkMagic returns NeoFS network magic. @@ -196,107 +146,77 @@ func (m *RequestMetaHeader) GetNetworkMagic() uint64 { // SetNetworkMagic sets NeoFS network magic. func (m *RequestMetaHeader) SetNetworkMagic(v uint64) { - if m != nil { - m.MagicNumber = v - } + m.MagicNumber = v } // SetVersion sets server protocol version. func (m *ResponseMetaHeader) SetVersion(v *refs.Version) { - if m != nil { - m.Version = v - } + m.Version = v } // SetEpoch sets server local epoch. func (m *ResponseMetaHeader) SetEpoch(v uint64) { - if m != nil { - m.Epoch = v - } + m.Epoch = v } // SetTtl sets response TTL. func (m *ResponseMetaHeader) SetTtl(v uint32) { - if m != nil { - m.Ttl = v - } + m.Ttl = v } // SetXHeaders sets response X-Headers. func (m *ResponseMetaHeader) SetXHeaders(v []*XHeader) { - if m != nil { - m.XHeaders = v - } + m.XHeaders = v } // SetOrigin sets origin response meta header. func (m *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { - if m != nil { - m.Origin = v - } + m.Origin = v } // SetStatus sets response status. func (m *ResponseMetaHeader) SetStatus(v *status.Status) { - if m != nil { - m.Status = v - } + m.Status = v } // SetBodySignature sets signature of the request body. func (m *RequestVerificationHeader) SetBodySignature(v *refs.Signature) { - if m != nil { - m.BodySignature = v - } + m.BodySignature = v } // SetMetaSignature sets signature of the request meta. func (m *RequestVerificationHeader) SetMetaSignature(v *refs.Signature) { - if m != nil { - m.MetaSignature = v - } + m.MetaSignature = v } // SetOriginSignature sets signature of the origin verification header of the request. func (m *RequestVerificationHeader) SetOriginSignature(v *refs.Signature) { - if m != nil { - m.OriginSignature = v - } + m.OriginSignature = v } // SetOrigin sets origin verification header of the request. func (m *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { - if m != nil { - m.Origin = v - } + m.Origin = v } // SetBodySignature sets signature of the response body. func (m *ResponseVerificationHeader) SetBodySignature(v *refs.Signature) { - if m != nil { - m.BodySignature = v - } + m.BodySignature = v } // SetMetaSignature sets signature of the response meta. func (m *ResponseVerificationHeader) SetMetaSignature(v *refs.Signature) { - if m != nil { - m.MetaSignature = v - } + m.MetaSignature = v } // SetOriginSignature sets signature of the origin verification header of the response. func (m *ResponseVerificationHeader) SetOriginSignature(v *refs.Signature) { - if m != nil { - m.OriginSignature = v - } + m.OriginSignature = v } // SetOrigin sets origin verification header of the response. func (m *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { - if m != nil { - m.Origin = v - } + m.Origin = v } // FromString parses ObjectSessionContext_Verb from a string representation, diff --git a/session/types.go b/session/types.go index 65f4728..139bf57 100644 --- a/session/types.go +++ b/session/types.go @@ -144,9 +144,7 @@ func (c *CreateRequestBody) GetOwnerID() *refs.OwnerID { } func (c *CreateRequestBody) SetOwnerID(v *refs.OwnerID) { - if c != nil { - c.ownerID = v - } + c.ownerID = v } func (c *CreateRequestBody) GetExpiration() uint64 { @@ -158,9 +156,7 @@ func (c *CreateRequestBody) GetExpiration() uint64 { } func (c *CreateRequestBody) SetExpiration(v uint64) { - if c != nil { - c.expiration = v - } + c.expiration = v } func (c *CreateRequest) GetBody() *CreateRequestBody { @@ -172,9 +168,7 @@ func (c *CreateRequest) GetBody() *CreateRequestBody { } func (c *CreateRequest) SetBody(v *CreateRequestBody) { - if c != nil { - c.body = v - } + c.body = v } func (c *CreateRequest) GetMetaHeader() *RequestMetaHeader { @@ -186,9 +180,7 @@ func (c *CreateRequest) GetMetaHeader() *RequestMetaHeader { } func (c *CreateRequest) SetMetaHeader(v *RequestMetaHeader) { - if c != nil { - c.metaHeader = v - } + c.metaHeader = v } func (c *CreateRequest) GetVerificationHeader() *RequestVerificationHeader { @@ -200,9 +192,7 @@ func (c *CreateRequest) GetVerificationHeader() *RequestVerificationHeader { } func (c *CreateRequest) SetVerificationHeader(v *RequestVerificationHeader) { - if c != nil { - c.verifyHeader = v - } + c.verifyHeader = v } func (c *CreateResponseBody) GetID() []byte { @@ -214,9 +204,7 @@ func (c *CreateResponseBody) GetID() []byte { } func (c *CreateResponseBody) SetID(v []byte) { - if c != nil { - c.id = v - } + c.id = v } func (c *CreateResponseBody) GetSessionKey() []byte { @@ -228,9 +216,7 @@ func (c *CreateResponseBody) GetSessionKey() []byte { } func (c *CreateResponseBody) SetSessionKey(v []byte) { - if c != nil { - c.sessionKey = v - } + c.sessionKey = v } func (c *CreateResponse) GetBody() *CreateResponseBody { @@ -242,9 +228,7 @@ func (c *CreateResponse) GetBody() *CreateResponseBody { } func (c *CreateResponse) SetBody(v *CreateResponseBody) { - if c != nil { - c.body = v - } + c.body = v } func (c *CreateResponse) GetMetaHeader() *ResponseMetaHeader { @@ -256,9 +240,7 @@ func (c *CreateResponse) GetMetaHeader() *ResponseMetaHeader { } func (c *CreateResponse) SetMetaHeader(v *ResponseMetaHeader) { - if c != nil { - c.metaHeader = v - } + c.metaHeader = v } func (c *CreateResponse) GetVerificationHeader() *ResponseVerificationHeader { @@ -270,9 +252,7 @@ func (c *CreateResponse) GetVerificationHeader() *ResponseVerificationHeader { } func (c *CreateResponse) SetVerificationHeader(v *ResponseVerificationHeader) { - if c != nil { - c.verifyHeader = v - } + c.verifyHeader = v } func (x *XHeader) GetKey() string { @@ -284,9 +264,7 @@ func (x *XHeader) GetKey() string { } func (x *XHeader) SetKey(v string) { - if x != nil { - x.key = v - } + x.key = v } func (x *XHeader) GetValue() string { @@ -298,9 +276,7 @@ func (x *XHeader) GetValue() string { } func (x *XHeader) SetValue(v string) { - if x != nil { - x.val = v - } + x.val = v } func (r *RequestVerificationHeader) GetBodySignature() *refs.Signature { @@ -312,9 +288,7 @@ func (r *RequestVerificationHeader) GetBodySignature() *refs.Signature { } func (r *RequestVerificationHeader) SetBodySignature(v *refs.Signature) { - if r != nil { - r.bodySig = v - } + r.bodySig = v } func (r *RequestVerificationHeader) GetMetaSignature() *refs.Signature { @@ -326,9 +300,7 @@ func (r *RequestVerificationHeader) GetMetaSignature() *refs.Signature { } func (r *RequestVerificationHeader) SetMetaSignature(v *refs.Signature) { - if r != nil { - r.metaSig = v - } + r.metaSig = v } func (r *RequestVerificationHeader) GetOriginSignature() *refs.Signature { @@ -340,9 +312,7 @@ func (r *RequestVerificationHeader) GetOriginSignature() *refs.Signature { } func (r *RequestVerificationHeader) SetOriginSignature(v *refs.Signature) { - if r != nil { - r.originSig = v - } + r.originSig = v } func (r *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader { @@ -354,9 +324,7 @@ func (r *RequestVerificationHeader) GetOrigin() *RequestVerificationHeader { } func (r *RequestVerificationHeader) SetOrigin(v *RequestVerificationHeader) { - if r != nil { - r.origin = v - } + r.origin = v } func (r *RequestMetaHeader) GetVersion() *refs.Version { @@ -368,9 +336,7 @@ func (r *RequestMetaHeader) GetVersion() *refs.Version { } func (r *RequestMetaHeader) SetVersion(v *refs.Version) { - if r != nil { - r.version = v - } + r.version = v } func (r *RequestMetaHeader) GetTTL() uint32 { @@ -382,9 +348,7 @@ func (r *RequestMetaHeader) GetTTL() uint32 { } func (r *RequestMetaHeader) SetTTL(v uint32) { - if r != nil { - r.ttl = v - } + r.ttl = v } func (r *RequestMetaHeader) GetEpoch() uint64 { @@ -396,9 +360,7 @@ func (r *RequestMetaHeader) GetEpoch() uint64 { } func (r *RequestMetaHeader) SetEpoch(v uint64) { - if r != nil { - r.epoch = v - } + r.epoch = v } func (r *RequestMetaHeader) GetXHeaders() []XHeader { @@ -410,9 +372,7 @@ func (r *RequestMetaHeader) GetXHeaders() []XHeader { } func (r *RequestMetaHeader) SetXHeaders(v []XHeader) { - if r != nil { - r.xHeaders = v - } + r.xHeaders = v } func (r *RequestMetaHeader) GetSessionToken() *Token { @@ -424,9 +384,7 @@ func (r *RequestMetaHeader) GetSessionToken() *Token { } func (r *RequestMetaHeader) SetSessionToken(v *Token) { - if r != nil { - r.sessionToken = v - } + r.sessionToken = v } func (r *RequestMetaHeader) GetBearerToken() *acl.BearerToken { @@ -438,9 +396,7 @@ func (r *RequestMetaHeader) GetBearerToken() *acl.BearerToken { } func (r *RequestMetaHeader) SetBearerToken(v *acl.BearerToken) { - if r != nil { - r.bearerToken = v - } + r.bearerToken = v } func (r *RequestMetaHeader) GetOrigin() *RequestMetaHeader { @@ -452,9 +408,7 @@ func (r *RequestMetaHeader) GetOrigin() *RequestMetaHeader { } func (r *RequestMetaHeader) SetOrigin(v *RequestMetaHeader) { - if r != nil { - r.origin = v - } + r.origin = v } // GetNetworkMagic returns NeoFS network magic. @@ -468,9 +422,7 @@ func (r *RequestMetaHeader) GetNetworkMagic() uint64 { // SetNetworkMagic sets NeoFS network magic. func (r *RequestMetaHeader) SetNetworkMagic(v uint64) { - if r != nil { - r.netMagic = v - } + r.netMagic = v } func (l *TokenLifetime) GetExp() uint64 { @@ -482,9 +434,7 @@ func (l *TokenLifetime) GetExp() uint64 { } func (l *TokenLifetime) SetExp(v uint64) { - if l != nil { - l.exp = v - } + l.exp = v } func (l *TokenLifetime) GetNbf() uint64 { @@ -496,9 +446,7 @@ func (l *TokenLifetime) GetNbf() uint64 { } func (l *TokenLifetime) SetNbf(v uint64) { - if l != nil { - l.nbf = v - } + l.nbf = v } func (l *TokenLifetime) GetIat() uint64 { @@ -510,9 +458,7 @@ func (l *TokenLifetime) GetIat() uint64 { } func (l *TokenLifetime) SetIat(v uint64) { - if l != nil { - l.iat = v - } + l.iat = v } func (r *ResponseVerificationHeader) GetBodySignature() *refs.Signature { @@ -524,9 +470,7 @@ func (r *ResponseVerificationHeader) GetBodySignature() *refs.Signature { } func (r *ResponseVerificationHeader) SetBodySignature(v *refs.Signature) { - if r != nil { - r.bodySig = v - } + r.bodySig = v } func (r *ResponseVerificationHeader) GetMetaSignature() *refs.Signature { @@ -538,9 +482,7 @@ func (r *ResponseVerificationHeader) GetMetaSignature() *refs.Signature { } func (r *ResponseVerificationHeader) SetMetaSignature(v *refs.Signature) { - if r != nil { - r.metaSig = v - } + r.metaSig = v } func (r *ResponseVerificationHeader) GetOriginSignature() *refs.Signature { @@ -552,9 +494,7 @@ func (r *ResponseVerificationHeader) GetOriginSignature() *refs.Signature { } func (r *ResponseVerificationHeader) SetOriginSignature(v *refs.Signature) { - if r != nil { - r.originSig = v - } + r.originSig = v } func (r *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader { @@ -566,9 +506,7 @@ func (r *ResponseVerificationHeader) GetOrigin() *ResponseVerificationHeader { } func (r *ResponseVerificationHeader) SetOrigin(v *ResponseVerificationHeader) { - if r != nil { - r.origin = v - } + r.origin = v } func (r *ResponseMetaHeader) GetVersion() *refs.Version { @@ -580,9 +518,7 @@ func (r *ResponseMetaHeader) GetVersion() *refs.Version { } func (r *ResponseMetaHeader) SetVersion(v *refs.Version) { - if r != nil { - r.version = v - } + r.version = v } func (r *ResponseMetaHeader) GetTTL() uint32 { @@ -594,9 +530,7 @@ func (r *ResponseMetaHeader) GetTTL() uint32 { } func (r *ResponseMetaHeader) SetTTL(v uint32) { - if r != nil { - r.ttl = v - } + r.ttl = v } func (r *ResponseMetaHeader) GetEpoch() uint64 { @@ -608,9 +542,7 @@ func (r *ResponseMetaHeader) GetEpoch() uint64 { } func (r *ResponseMetaHeader) SetEpoch(v uint64) { - if r != nil { - r.epoch = v - } + r.epoch = v } func (r *ResponseMetaHeader) GetXHeaders() []XHeader { @@ -622,9 +554,7 @@ func (r *ResponseMetaHeader) GetXHeaders() []XHeader { } func (r *ResponseMetaHeader) SetXHeaders(v []XHeader) { - if r != nil { - r.xHeaders = v - } + r.xHeaders = v } func (r *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { @@ -636,9 +566,7 @@ func (r *ResponseMetaHeader) GetOrigin() *ResponseMetaHeader { } func (r *ResponseMetaHeader) SetOrigin(v *ResponseMetaHeader) { - if r != nil { - r.origin = v - } + r.origin = v } // GetStatus returns response status. @@ -652,9 +580,7 @@ func (r *ResponseMetaHeader) GetStatus() *status.Status { // SetStatus sets response status. func (r *ResponseMetaHeader) SetStatus(v *status.Status) { - if r != nil { - r.status = v - } + r.status = v } // SetStatus sets status of the message which can carry ResponseMetaHeader. @@ -685,9 +611,7 @@ func (c *ObjectSessionContext) GetVerb() ObjectSessionVerb { } func (c *ObjectSessionContext) SetVerb(v ObjectSessionVerb) { - if c != nil { - c.verb = v - } + c.verb = v } func (c *ObjectSessionContext) GetAddress() *refs.Address { @@ -699,9 +623,7 @@ func (c *ObjectSessionContext) GetAddress() *refs.Address { } func (c *ObjectSessionContext) SetAddress(v *refs.Address) { - if c != nil { - c.addr = v - } + c.addr = v } func (t *TokenBody) GetID() []byte { @@ -713,9 +635,7 @@ func (t *TokenBody) GetID() []byte { } func (t *TokenBody) SetID(v []byte) { - if t != nil { - t.id = v - } + t.id = v } func (t *TokenBody) GetOwnerID() *refs.OwnerID { @@ -727,9 +647,7 @@ func (t *TokenBody) GetOwnerID() *refs.OwnerID { } func (t *TokenBody) SetOwnerID(v *refs.OwnerID) { - if t != nil { - t.ownerID = v - } + t.ownerID = v } func (t *TokenBody) GetLifetime() *TokenLifetime { @@ -741,9 +659,7 @@ func (t *TokenBody) GetLifetime() *TokenLifetime { } func (t *TokenBody) SetLifetime(v *TokenLifetime) { - if t != nil { - t.lifetime = v - } + t.lifetime = v } func (t *TokenBody) GetSessionKey() []byte { @@ -755,9 +671,7 @@ func (t *TokenBody) GetSessionKey() []byte { } func (t *TokenBody) SetSessionKey(v []byte) { - if t != nil { - t.sessionKey = v - } + t.sessionKey = v } func (t *TokenBody) GetContext() TokenContext { @@ -769,9 +683,7 @@ func (t *TokenBody) GetContext() TokenContext { } func (t *TokenBody) SetContext(v TokenContext) { - if t != nil { - t.ctx = v - } + t.ctx = v } func (t *Token) GetBody() *TokenBody { @@ -783,9 +695,7 @@ func (t *Token) GetBody() *TokenBody { } func (t *Token) SetBody(v *TokenBody) { - if t != nil { - t.body = v - } + t.body = v } func (t *Token) GetSignature() *refs.Signature { @@ -797,9 +707,7 @@ func (t *Token) GetSignature() *refs.Signature { } func (t *Token) SetSignature(v *refs.Signature) { - if t != nil { - t.sig = v - } + t.sig = v } // ContainerSessionVerb represents NeoFS API v2 @@ -843,9 +751,7 @@ func (x *ContainerSessionContext) Verb() ContainerSessionVerb { // SetVerb sets type of request for which the token is issued. func (x *ContainerSessionContext) SetVerb(v ContainerSessionVerb) { - if x != nil { - x.verb = v - } + x.verb = v } // Wildcard returns wildcard flag of the container session. @@ -859,9 +765,7 @@ func (x *ContainerSessionContext) Wildcard() bool { // SetWildcard sets wildcard flag of the container session. func (x *ContainerSessionContext) SetWildcard(v bool) { - if x != nil { - x.wildcard = v - } + x.wildcard = v } // ContainerID returns identifier of the container related to the session. @@ -875,7 +779,5 @@ func (x *ContainerSessionContext) ContainerID() *refs.ContainerID { // SetContainerID sets identifier of the container related to the session. func (x *ContainerSessionContext) SetContainerID(v *refs.ContainerID) { - if x != nil { - x.cid = v - } + x.cid = v } diff --git a/session/util.go b/session/util.go index 5ee46d3..f39097d 100644 --- a/session/util.go +++ b/session/util.go @@ -23,9 +23,7 @@ func (c *RequestHeaders) GetMetaHeader() *RequestMetaHeader { // SetMetaHeader sets meta header of the request. func (c *RequestHeaders) SetMetaHeader(v *RequestMetaHeader) { - if c != nil { - c.metaHeader = v - } + c.metaHeader = v } // GetVerificationHeader returns verification header of the request. @@ -39,9 +37,7 @@ func (c *RequestHeaders) GetVerificationHeader() *RequestVerificationHeader { // SetVerificationHeader sets verification header of the request. func (c *RequestHeaders) SetVerificationHeader(v *RequestVerificationHeader) { - if c != nil { - c.verifyHeader = v - } + c.verifyHeader = v } func (c *RequestHeaders) ToMessage(m interface { @@ -106,9 +102,7 @@ func (c *ResponseHeaders) GetMetaHeader() *ResponseMetaHeader { // SetMetaHeader sets meta header of the response. func (c *ResponseHeaders) SetMetaHeader(v *ResponseMetaHeader) { - if c != nil { - c.metaHeader = v - } + c.metaHeader = v } // GetVerificationHeader returns verification header of the response. @@ -122,9 +116,7 @@ func (c *ResponseHeaders) GetVerificationHeader() *ResponseVerificationHeader { // SetVerificationHeader sets verification header of the response. func (c *ResponseHeaders) SetVerificationHeader(v *ResponseVerificationHeader) { - if c != nil { - c.verifyHeader = v - } + c.verifyHeader = v } func (c *ResponseHeaders) ToMessage(m interface { diff --git a/status/grpc/types.go b/status/grpc/types.go index eea2c82..993f632 100644 --- a/status/grpc/types.go +++ b/status/grpc/types.go @@ -2,35 +2,25 @@ package status // SetId sets identifier of the Status_Detail. func (x *Status_Detail) SetId(v uint32) { - if x != nil { - x.Id = v - } + x.Id = v } // SetValue sets value of the Status_Detail. func (x *Status_Detail) SetValue(v []byte) { - if x != nil { - x.Value = v - } + x.Value = v } // SetCode sets code of the Status. func (x *Status) SetCode(v uint32) { - if x != nil { - x.Code = v - } + x.Code = v } // SetMessage sets message about the Status. func (x *Status) SetMessage(v string) { - if x != nil { - x.Message = v - } + x.Message = v } // SetDetails sets details of the Status. func (x *Status) SetDetails(v []*Status_Detail) { - if x != nil { - x.Details = v - } + x.Details = v } diff --git a/status/types.go b/status/types.go index 8bcb3af..2259b3a 100644 --- a/status/types.go +++ b/status/types.go @@ -18,9 +18,7 @@ func (x *Detail) ID() uint32 { // SetID sets identifier of the Detail. func (x *Detail) SetID(id uint32) { - if x != nil { - x.id = id - } + x.id = id } // Value returns value of the Detail. @@ -34,9 +32,7 @@ func (x *Detail) Value() []byte { // SetValue sets value of the Detail. func (x *Detail) SetValue(val []byte) { - if x != nil { - x.val = val - } + x.val = val } // Code represents NeoFS API V2-compatible status code. @@ -67,9 +63,7 @@ func (x *Status) Code() Code { // SetCode sets code of the Status. func (x *Status) SetCode(code Code) { - if x != nil { - x.code = code - } + x.code = code } // Message sets message of the Status. @@ -83,9 +77,7 @@ func (x *Status) Message() string { // SetMessage sets message of the Status. func (x *Status) SetMessage(msg string) { - if x != nil { - x.msg = msg - } + x.msg = msg } // NumberOfParameters returns number of network parameters. diff --git a/storagegroup/grpc/types.go b/storagegroup/grpc/types.go index 5bba1b1..1c7a8a8 100644 --- a/storagegroup/grpc/types.go +++ b/storagegroup/grpc/types.go @@ -6,28 +6,20 @@ import ( // SetValidationDataSize sets the total size of the payloads of the storage group. func (m *StorageGroup) SetValidationDataSize(v uint64) { - if m != nil { - m.ValidationDataSize = v - } + m.ValidationDataSize = v } // SetValidationHash sets total homomorphic hash of the storage group payloads. func (m *StorageGroup) SetValidationHash(v *refs.Checksum) { - if m != nil { - m.ValidationHash = v - } + m.ValidationHash = v } // SetExpirationEpoch sets number of the last epoch of the storage group lifetime. func (m *StorageGroup) SetExpirationEpoch(v uint64) { - if m != nil { - m.ExpirationEpoch = v - } + m.ExpirationEpoch = v } // SetMembers sets list of the identifiers of the storage group members. func (m *StorageGroup) SetMembers(v []*refs.ObjectID) { - if m != nil { - m.Members = v - } + m.Members = v } diff --git a/storagegroup/types.go b/storagegroup/types.go index 38f66f6..a1926c7 100644 --- a/storagegroup/types.go +++ b/storagegroup/types.go @@ -27,9 +27,7 @@ func (s *StorageGroup) GetValidationDataSize() uint64 { // SetValidationDataSize into unified storage group structure. func (s *StorageGroup) SetValidationDataSize(v uint64) { - if s != nil { - s.size = v - } + s.size = v } // GetValidationHash of unified storage group structure. @@ -43,9 +41,7 @@ func (s *StorageGroup) GetValidationHash() *refs.Checksum { // SetValidationHash into unified storage group structure. func (s *StorageGroup) SetValidationHash(v *refs.Checksum) { - if s != nil { - s.hash = v - } + s.hash = v } // GetExpirationEpoch of unified storage group structure. @@ -59,9 +55,7 @@ func (s *StorageGroup) GetExpirationEpoch() uint64 { // SetExpirationEpoch into unified storage group structure. func (s *StorageGroup) SetExpirationEpoch(v uint64) { - if s != nil { - s.exp = v - } + s.exp = v } // GetMembers of unified storage group structure. Members are objects of @@ -77,7 +71,5 @@ func (s *StorageGroup) GetMembers() []refs.ObjectID { // SetMembers into unified storage group structure. Members are objects of // storage group. func (s *StorageGroup) SetMembers(v []refs.ObjectID) { - if s != nil { - s.members = v - } + s.members = v } diff --git a/subnet/grpc/types.go b/subnet/grpc/types.go index 60ccf36..58a7268 100644 --- a/subnet/grpc/types.go +++ b/subnet/grpc/types.go @@ -6,14 +6,10 @@ import ( // SetID returns identifier of the subnet. Nil arg is equivalent to zero subnet ID. func (x *SubnetInfo) SetID(id *refs.SubnetID) { - if x != nil { - x.Id = id - } + x.Id = id } // SetOwner sets subnet owner's ID in NeoFS system. func (x *SubnetInfo) SetOwner(id *refs.OwnerID) { - if x != nil { - x.Owner = id - } + x.Owner = id } diff --git a/tombstone/grpc/types.go b/tombstone/grpc/types.go index 17fe9db..aace76d 100644 --- a/tombstone/grpc/types.go +++ b/tombstone/grpc/types.go @@ -6,21 +6,15 @@ import ( // SetExpirationEpoch sets number of tombstone expiration epoch. func (x *Tombstone) SetExpirationEpoch(v uint64) { - if x != nil { - x.ExpirationEpoch = v - } + x.ExpirationEpoch = v } // SetSplitId sets identifier of split object hierarchy. func (x *Tombstone) SetSplitId(v []byte) { - if x != nil { - x.SplitId = v - } + x.SplitId = v } // SetMembers sets list of objects to be deleted. func (x *Tombstone) SetMembers(v []*refs.ObjectID) { - if x != nil { - x.Members = v - } + x.Members = v } diff --git a/tombstone/types.go b/tombstone/types.go index 6cce852..d04935d 100644 --- a/tombstone/types.go +++ b/tombstone/types.go @@ -25,9 +25,7 @@ func (s *Tombstone) GetExpirationEpoch() uint64 { // SetExpirationEpoch sets number of tombstone expiration epoch. func (s *Tombstone) SetExpirationEpoch(v uint64) { - if s != nil { - s.exp = v - } + s.exp = v } // GetSplitID returns identifier of split object hierarchy. @@ -41,9 +39,7 @@ func (s *Tombstone) GetSplitID() []byte { // SetSplitID sets identifier of split object hierarchy. func (s *Tombstone) SetSplitID(v []byte) { - if s != nil { - s.splitID = v - } + s.splitID = v } // GetMembers returns list of objects to be deleted. @@ -57,7 +53,5 @@ func (s *Tombstone) GetMembers() []refs.ObjectID { // SetMembers sets list of objects to be deleted. func (s *Tombstone) SetMembers(v []refs.ObjectID) { - if s != nil { - s.members = v - } + s.members = v }