Files
mesh-delivery/modules/mesh-delivery-checker/rules/names.go
T
jschoubben 71a35a6376 MV1: move contracts and sdk under modules/, importers follow
The delivery repository's contracts and SDK live under modules/ as
mesh-delivery-contracts and mesh-delivery-sdk, their Go module paths
renamed to match the folders (the TypeScript names already did), and
every importer in mesh-delivery, mesh-catalog, mesh-host, mesh-tools
and mesh-sdk follows in the same group: a design as it should be, one
path per module, checked by the group's check building every importer.

Builds: design 47 G §427, §88

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-12 05:09:56 +01:00

39 lines
1.3 KiB
Go

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
}