forked from TrueCloudLab/frostfs-api-go
[#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 <evgeniy@nspcc.ru>
This commit is contained in:
parent
50162741ac
commit
732dd51b1b
32 changed files with 714 additions and 2104 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue