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,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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue