From 854d4d69ae1a9dbd3c4bed056a169fd7e6ae7cf1 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sat, 10 Oct 2026 13:28:42 +0200 Subject: [PATCH] Answer stability round 1: a manifest's reads refuses a repeated module, and the test re-checking what the manifest tests pin goes --- internal/datafiles/manifest.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/datafiles/manifest.go b/internal/datafiles/manifest.go index e7a8c5a..77568f8 100644 --- a/internal/datafiles/manifest.go +++ b/internal/datafiles/manifest.go @@ -90,6 +90,7 @@ func decodeReads(v any) ([]string, error) { return nil, fmt.Errorf("reads must be a list, not %s", jsonvalue.Kind(v)) } out := make([]string, 0, len(items)) + seen := map[string]bool{} var errs []error for i, item := range items { module, isString := item.(string) @@ -98,7 +99,10 @@ func decodeReads(v any) ([]string, error) { errs = append(errs, fmt.Errorf("reads item %d must be a string, not %s", i+1, jsonvalue.Kind(item))) case module == "": errs = append(errs, fmt.Errorf("reads item %d is empty; it names a module", i+1)) + case seen[module]: + errs = append(errs, fmt.Errorf("reads item %d repeats %q", i+1, module)) default: + seen[module] = true out = append(out, module) } }