aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain/entities/reports/containers.go
blob: 6759fc4020ed4ada56cbf2ccc4646586fbeb5e23 (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
29
package reports

type RmReport struct {
	Id       string `json:"Id"` //nolint:revive,stylecheck
	Err      error  `json:"Err,omitempty"`
	RawInput string
}

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
}