blob: db9a66012663505472b574f77e11f5b2ebb1ded9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package reports
type RmReport struct {
Id string `json:"Id"` //nolint:revive,stylecheck
Err error `json:"Err,omitempty"`
}
func RmReportsIds(r []*RmReport) []string {
ids := make([]string, 0, len(r))
for _, v := range r {
if v == nil || v.Id == "" {
continue
}
ids = append(ids, v.Id)
}
return ids
}
func RmReportsErrs(r []*RmReport) []error {
errs := make([]error, 0, len(r))
for _, v := range r {
if v == nil || v.Err == nil {
continue
}
errs = append(errs, v.Err)
}
return errs
}
|