From 2b41d7996abc533f4832f7532c566ab8515a2eaa Mon Sep 17 00:00:00 2001 From: worstell Date: Thu, 26 Sep 2024 17:32:12 -0700 Subject: [PATCH] fix: don't export callees when callers are exported (#2856) --- go-runtime/schema/extract.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go-runtime/schema/extract.go b/go-runtime/schema/extract.go index 62acf4bba..c3b6811d4 100644 --- a/go-runtime/schema/extract.go +++ b/go-runtime/schema/extract.go @@ -406,7 +406,8 @@ func updateTransitiveVisibility(d schema.Decl, module *schema.Module) { return } - _ = schema.Visit(d, func(n schema.Node, next func() error) error { //nolint:errcheck + // exclude metadata children so we don't update callees to be exported if their callers are + _ = schema.VisitExcludingMetadataChildren(d, func(n schema.Node, next func() error) error { //nolint:errcheck ref, ok := n.(*schema.Ref) if !ok { return next()