From 0cde9623d320a5b9bab251b0e8d053bd31ab7adf Mon Sep 17 00:00:00 2001 From: cryo Date: Sat, 2 Aug 2025 04:20:55 +0800 Subject: [PATCH] mcp: fix comments (#221) ### change: Fix typos in some comments. --- mcp/server.go | 2 +- mcp/shared.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mcp/server.go b/mcp/server.go index 08effd7..b96edbe 100644 --- a/mcp/server.go +++ b/mcp/server.go @@ -215,7 +215,7 @@ func (s *Server) RemoveResources(uris ...string) { func() bool { return s.resources.remove(uris...) }) } -// AddResourceTemplate adds a [ResourceTemplate] to the server, or replaces on with the same URI. +// AddResourceTemplate adds a [ResourceTemplate] to the server, or replaces one with the same URI. // AddResourceTemplate panics if a URI template is invalid or not absolute (has an empty scheme). func (s *Server) AddResourceTemplate(t *ResourceTemplate, h ResourceHandler) { s.changeAndNotify(notificationResourceListChanged, &ResourceListChangedParams{}, diff --git a/mcp/shared.go b/mcp/shared.go index 54038f5..319071f 100644 --- a/mcp/shared.go +++ b/mcp/shared.go @@ -86,7 +86,7 @@ func defaultSendingMethodHandler[S Session](ctx context.Context, session S, meth return res, nil } -// Helper methods to avoid typed nil. +// Helper method to avoid typed nil. func orZero[T any, P *U, U any](p P) T { if p == nil { var zero T