From 0903357221cdfbb72ec325539c0a587320f25cd2 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 15 May 2026 17:43:21 +0800 Subject: [PATCH] Enforce prober/evaluator boundary in ObservationData --- checker/types.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/checker/types.go b/checker/types.go index c4d7bdc..444bd2c 100644 --- a/checker/types.go +++ b/checker/types.go @@ -3,6 +3,7 @@ package checker import ( "encoding/json" "fmt" + "slices" "github.com/miekg/dns" ) @@ -77,10 +78,8 @@ type NSResult struct { // Dedupes identical messages and caps the list with a sentinel summary. func (n *NSResult) appendError(format string, args ...any) { msg := fmt.Sprintf(format, args...) - for _, e := range n.Errors { - if e == msg { - return - } + if slices.Contains(n.Errors, msg) { + return } if len(n.Errors) >= maxNSResultErrors { n.suppressedErrors++ @@ -106,9 +105,8 @@ type ObservationData struct { ParentNS []string `json:"parent_ns,omitempty"` ParentQueryError string `json:"parent_query_error,omitempty"` // Union of DeclaredNS and ParentNS, de-duplicated. - Probed []string `json:"probed,omitempty"` - Results map[string]*NSResult `json:"results,omitempty"` - Findings []Finding `json:"findings"` + Probed []string `json:"probed,omitempty"` + Results map[string]*NSResult `json:"results,omitempty"` } // Local mirror of happyDomain's services/abstract.Origin. Duplicated on