summaryrefslogtreecommitdiff
path: root/pkg/domain/entities/reports/containers.go
blob: 54bcd092baf29d2630836545e5a41795477ab081 (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
	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
}