From ec43595b434e0fa68e73e8dbd115a3e301b5bb0e Mon Sep 17 00:00:00 2001 From: ozzyozbourne Date: Wed, 18 Jun 2025 15:16:21 -0400 Subject: [PATCH] fixed nil error --- examples/simple_client/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/simple_client/main.go b/examples/simple_client/main.go index 5deb99113..aba0a1f51 100644 --- a/examples/simple_client/main.go +++ b/examples/simple_client/main.go @@ -54,6 +54,11 @@ func main() { // Create client with the transport c = client.NewClient(stdioTransport) + // Start the client + if err := c.Start(ctx); err != nil { + log.Fatalf("Failed to start client: %v", err) + } + // Set up logging for stderr if available if stderr, ok := client.GetStderr(c); ok { go func() { @@ -84,11 +89,6 @@ func main() { c = client.NewClient(httpTransport) } - // Start the client - if err := c.Start(ctx); err != nil { - log.Fatalf("Failed to start client: %v", err) - } - // Set up notification handler c.OnNotification(func(notification mcp.JSONRPCNotification) { fmt.Printf("Received notification: %s\n", notification.Method)