internal/mcp: pointerize all the things
Use pointers for the protocol's struct types, to future-proof against them getting large. Change-Id: I55b204080a41c8140539697ba264e502e912e613 Reviewed-on: https://go-review.googlesource.com/c/tools/+/672575 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
7b100d7b30
commit
02fa1b3ea6
1 changed files with 137 additions and 98 deletions
|
|
@ -20,7 +20,7 @@ func testPromptHandler[T any](context.Context, *mcp.ServerConnection, T) (*mcp.G
|
|||
func TestNewPrompt(t *testing.T) {
|
||||
tests := []struct {
|
||||
prompt *mcp.ServerPrompt
|
||||
want []mcp.PromptArgument
|
||||
want []*mcp.PromptArgument
|
||||
}{
|
||||
{
|
||||
mcp.NewPrompt("empty", "", testPromptHandler[struct{}]),
|
||||
|
|
@ -28,7 +28,7 @@ func TestNewPrompt(t *testing.T) {
|
|||
},
|
||||
{
|
||||
mcp.NewPrompt("add_arg", "", testPromptHandler[struct{}], mcp.Argument("x")),
|
||||
[]mcp.PromptArgument{{Name: "x"}},
|
||||
[]*mcp.PromptArgument{{Name: "x"}},
|
||||
},
|
||||
{
|
||||
mcp.NewPrompt("combo", "", testPromptHandler[struct {
|
||||
|
|
@ -38,7 +38,7 @@ func TestNewPrompt(t *testing.T) {
|
|||
}],
|
||||
mcp.Argument("name", mcp.Description("the person's name")),
|
||||
mcp.Argument("State", mcp.Required(false))),
|
||||
[]mcp.PromptArgument{
|
||||
[]*mcp.PromptArgument{
|
||||
{Name: "State"},
|
||||
{Name: "country"},
|
||||
{Name: "name", Required: true, Description: "the person's name"},
|
||||
|
|
|
|||
Loading…
Reference in a new issue