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