mcp/client: fix typo in changeAndNotify&ReadResource (#68)

This PR updates the comments for func changeAndNotify and ReadResource to correct typos and improve clarity.
This commit is contained in:
cryo 2025-06-30 19:51:01 +08:00 • committed by GitHub
commit 45f700ea13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -191,7 +191,7 @@ func (c *Client) RemoveRoots(uris ...string) {
func() bool { return c.roots.remove(uris...) })
}
// changeAndNotifyClient is called when a feature is added or removed.
// changeAndNotify is called when a feature is added or removed.
// It calls change, which should do the work and report whether a change actually occurred.
// If there was a change, it notifies a snapshot of the sessions.
func (c *Client) changeAndNotify(notification string, params Params, change func() bool) {
@ -347,7 +347,7 @@ func (cs *ClientSession) ListResourceTemplates(ctx context.Context, params *List
return handleSend[*ListResourceTemplatesResult](ctx, cs, methodListResourceTemplates, orZero[Params](params))
}
// ReadResource ask the server to read a resource and return its contents.
// ReadResource asks the server to read a resource and return its contents.
func (cs *ClientSession) ReadResource(ctx context.Context, params *ReadResourceParams) (*ReadResourceResult, error) {
return handleSend[*ReadResourceResult](ctx, cs, methodReadResource, orZero[Params](params))
}