package rules import checker "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshdeliverychecker" // FailedFirst names what failed: a test (its package and name) or a machine, with the words of the failure. It is the shape // of the verdict's `failed` and of each entry of its `failures` (the seat's two types of it have the same fields), so the // rules judge with one and convert at the verdict's edge (failureItems, failedList). type FailedFirst = checker.VerdictsByGroupHeadsValueFailed func failureItems(list []FailedFirst) []checker.VerdictsByGroupHeadsValueFailuresItem { if list == nil { return nil } out := make([]checker.VerdictsByGroupHeadsValueFailuresItem, len(list)) for i, f := range list { out[i] = checker.VerdictsByGroupHeadsValueFailuresItem(f) } return out } func failedList(items []checker.VerdictsByGroupHeadsValueFailuresItem) []FailedFirst { if items == nil { return nil } out := make([]FailedFirst, len(items)) for i, f := range items { out[i] = FailedFirst(f) } return out } // failedOf is the first failure a verdict names: the zero value of a verdict that names none. func failedOf(v checker.VerdictsByGroupHeadsValue) FailedFirst { if v.Failed == nil { return FailedFirst{} } return *v.Failed }