Skip to content

Commit 2be3442

Browse files
committed
fmt
1 parent 7b9d991 commit 2be3442

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

client/transport/sse_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ func TestSSE(t *testing.T) {
408408
t.Run("SSEEventWithoutEventField", func(t *testing.T) {
409409
// Test that SSE events with only data field (no event field) are processed correctly
410410
// This tests the fix for issue #369
411-
411+
412412
var messageReceived chan struct{}
413-
413+
414414
// Create a custom mock server that sends SSE events without event field
415415
sseHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
416416
w.Header().Set("Content-Type", "text/event-stream")
@@ -449,7 +449,7 @@ func TestSSE(t *testing.T) {
449449
messageHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
450450
w.Header().Set("Content-Type", "application/json")
451451
w.WriteHeader(http.StatusAccepted)
452-
452+
453453
// Signal that message was received
454454
close(messageReceived)
455455
})

client/transport/streamable_http_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func TestStreamableHTTP(t *testing.T) {
418418
t.Run("SSEEventWithoutEventField", func(t *testing.T) {
419419
// Test that SSE events with only data field (no event field) are processed correctly
420420
// This tests the fix for issue #369
421-
421+
422422
// Create a custom mock server that sends SSE events without event field
423423
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
424424
if r.Method != http.MethodPost {
@@ -438,7 +438,7 @@ func TestStreamableHTTP(t *testing.T) {
438438
// This should be processed as a "message" event according to SSE spec
439439
w.Header().Set("Content-Type", "text/event-stream")
440440
w.WriteHeader(http.StatusOK)
441-
441+
442442
response := map[string]any{
443443
"jsonrpc": "2.0",
444444
"id": request["id"],

mcp/tools.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -467,24 +467,24 @@ func (r CallToolRequest) RequireBoolSlice(key string) ([]bool, error) {
467467
// MarshalJSON implements custom JSON marshaling for CallToolResult
468468
func (r CallToolResult) MarshalJSON() ([]byte, error) {
469469
m := make(map[string]any)
470-
470+
471471
// Marshal Meta if present
472472
if r.Meta != nil {
473473
m["_meta"] = r.Meta
474474
}
475-
475+
476476
// Marshal Content array
477477
content := make([]any, len(r.Content))
478478
for i, c := range r.Content {
479479
content[i] = c
480480
}
481481
m["content"] = content
482-
482+
483483
// Marshal IsError if true
484484
if r.IsError {
485485
m["isError"] = r.IsError
486486
}
487-
487+
488488
return json.Marshal(m)
489489
}
490490

@@ -494,14 +494,14 @@ func (r *CallToolResult) UnmarshalJSON(data []byte) error {
494494
if err := json.Unmarshal(data, &raw); err != nil {
495495
return err
496496
}
497-
497+
498498
// Unmarshal Meta
499499
if meta, ok := raw["_meta"]; ok {
500500
if metaMap, ok := meta.(map[string]any); ok {
501501
r.Meta = metaMap
502502
}
503503
}
504-
504+
505505
// Unmarshal Content array
506506
if contentRaw, ok := raw["content"]; ok {
507507
if contentArray, ok := contentRaw.([]any); ok {
@@ -519,14 +519,14 @@ func (r *CallToolResult) UnmarshalJSON(data []byte) error {
519519
}
520520
}
521521
}
522-
522+
523523
// Unmarshal IsError
524524
if isError, ok := raw["isError"]; ok {
525525
if isErrorBool, ok := isError.(bool); ok {
526526
r.IsError = isErrorBool
527527
}
528528
}
529-
529+
530530
return nil
531531
}
532532

mcptest/mcptest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (s *Server) Start(ctx context.Context) error {
142142
mcpServer.AddTools(s.tools...)
143143
mcpServer.AddPrompts(s.prompts...)
144144
mcpServer.AddResources(s.resources...)
145-
145+
146146
for _, template := range s.resourceTemplates {
147147
mcpServer.AddResourceTemplate(template.Template, template.Handler)
148148
}

0 commit comments

Comments
 (0)