From 7b22fd3141d1a7d6a9a6557b120eee9fca09bc0f Mon Sep 17 00:00:00 2001 From: Virgil Date: Thu, 2 Apr 2026 07:29:59 +0000 Subject: [PATCH] refactor(mcp): remove unused registry iterator helper Keeps the registry surface tighter by removing the unused splitTagSeq helper and updating the test to cover the production splitTag helper directly. Co-Authored-By: Virgil --- pkg/mcp/iter_test.go | 4 ++-- pkg/mcp/registry.go | 14 -------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/pkg/mcp/iter_test.go b/pkg/mcp/iter_test.go index d4d3d12..358a4b3 100644 --- a/pkg/mcp/iter_test.go +++ b/pkg/mcp/iter_test.go @@ -29,9 +29,9 @@ func TestService_Iterators(t *testing.T) { } } -func TestRegistry_SplitTagSeq(t *testing.T) { +func TestRegistry_SplitTag(t *testing.T) { tag := "name,omitempty,json" - parts := slices.Collect(splitTagSeq(tag)) + parts := splitTag(tag) expected := []string{"name", "omitempty", "json"} if !slices.Equal(parts, expected) { diff --git a/pkg/mcp/registry.go b/pkg/mcp/registry.go index 2126306..91c6ccf 100644 --- a/pkg/mcp/registry.go +++ b/pkg/mcp/registry.go @@ -4,7 +4,6 @@ package mcp import ( "context" - "iter" "reflect" core "dappco.re/go/core" @@ -134,19 +133,6 @@ func splitTag(tag string) []string { return core.Split(tag, ",") } -// splitTagSeq returns an iterator over the tag parts. -func splitTagSeq(tag string) iter.Seq[string] { - // core.Split returns []string; wrap as iterator - parts := core.Split(tag, ",") - return func(yield func(string) bool) { - for _, p := range parts { - if !yield(p) { - return - } - } - } -} - // goTypeToJSONType maps Go types to JSON Schema types. func goTypeToJSONType(t reflect.Type) string { switch t.Kind() {