From a73b7973531f2b8632269a8c8359acf69ee61f45 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 13 May 2026 14:28:43 +0300 Subject: add compile-time interface assertions for public types (task c4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the var _ Interface = (*Concrete)(nil) coverage started in j3 to cover the remaining public types not yet guarded: - *file.FdFile → file.File (file/file.go) - streamrow.Row → globalfilter.Candidate (streamrow/row.go; adds globalfilter import — no cycle since globalfilter does not import streamrow) - *streamrow.RingBuffer → eventstream.Source (tui/eventstream/ringbuffer.go; already a type alias for streamrow.RingBuffer) - *probemanager.Manager → tui/probes.Manager (tui/probes/model.go) - All 9 generated *types.*Event types → event.Event in the new file internal/event/interface_assertions.go (non-generated, lives in the event package which already imports types, so no new import cycle) Co-Authored-By: Claude Sonnet 4.6 --- internal/streamrow/row.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/streamrow') diff --git a/internal/streamrow/row.go b/internal/streamrow/row.go index 457fcc0..026aa93 100644 --- a/internal/streamrow/row.go +++ b/internal/streamrow/row.go @@ -5,6 +5,7 @@ import ( "time" "ior/internal/event" + "ior/internal/globalfilter" "ior/internal/types" ) @@ -121,6 +122,15 @@ func New(seq uint64, pair *event.Pair) Row { return row } +// --- compile-time interface satisfaction assertion --- +// +// Row must satisfy globalfilter.Candidate so the TUI eventstream model can +// pass stream rows directly into Filter.Matches for live filtering. All +// Candidate methods are defined on the value receiver so both Row and *Row +// satisfy the interface; we assert the value form as it is the common usage. + +var _ globalfilter.Candidate = Row{} + // NewWarning creates a synthetic row for non-fatal runtime warnings. func NewWarning(seq uint64, message string) Row { now := uint64(time.Now().UnixNano()) -- cgit v1.2.3