[#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:
Evgenii Stratonikov 2022-03-23 14:42:57 +03:00 committed by Alex Vanin
parent 50162741ac
commit 732dd51b1b
32 changed files with 714 additions and 2104 deletions

View file

@ -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
}