forked from TrueCloudLab/frostfs-api-go
[#376] status: Remove pointer from Detail
slice
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
0cab407378
commit
43fd3cfb4f
5 changed files with 14 additions and 20 deletions
|
@ -53,7 +53,7 @@ type Status struct {
|
|||
|
||||
msg string
|
||||
|
||||
details []*Detail
|
||||
details []Detail
|
||||
}
|
||||
|
||||
// Code returns code of the Status.
|
||||
|
@ -104,7 +104,7 @@ func (x *Status) NumberOfDetails() int {
|
|||
func (x *Status) IterateDetails(f func(*Detail) bool) {
|
||||
if x != nil {
|
||||
for i := range x.details {
|
||||
if f(x.details[i]) {
|
||||
if f(&x.details[i]) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -119,14 +119,14 @@ func (x *Status) ResetDetails() {
|
|||
}
|
||||
|
||||
// AppendDetails appends the list of details to the Status.
|
||||
func (x *Status) AppendDetails(ds ...*Detail) {
|
||||
func (x *Status) AppendDetails(ds ...Detail) {
|
||||
if x != nil {
|
||||
x.details = append(x.details, ds...)
|
||||
}
|
||||
}
|
||||
|
||||
// SetStatusDetails sets Detail list of the Status.
|
||||
func SetStatusDetails(dst *Status, ds []*Detail) {
|
||||
func SetStatusDetails(dst *Status, ds []Detail) {
|
||||
dst.ResetDetails()
|
||||
dst.AppendDetails(ds...)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue