Skip to content

Commit 93176e8

Browse files
authored
fixed nil error (#406)
1 parent a077d27 commit 93176e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/simple_client/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ func main() {
5454
// Create client with the transport
5555
c = client.NewClient(stdioTransport)
5656

57+
// Start the client
58+
if err := c.Start(ctx); err != nil {
59+
log.Fatalf("Failed to start client: %v", err)
60+
}
61+
5762
// Set up logging for stderr if available
5863
if stderr, ok := client.GetStderr(c); ok {
5964
go func() {
@@ -84,11 +89,6 @@ func main() {
8489
c = client.NewClient(httpTransport)
8590
}
8691

87-
// Start the client
88-
if err := c.Start(ctx); err != nil {
89-
log.Fatalf("Failed to start client: %v", err)
90-
}
91-
9292
// Set up notification handler
9393
c.OnNotification(func(notification mcp.JSONRPCNotification) {
9494
fmt.Printf("Received notification: %s\n", notification.Method)

0 commit comments

Comments
 (0)