mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 15:10:01 +08:00
16 lines
348 B
Go
16 lines
348 B
Go
package mcp
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// ptr is a helper function to get a pointer to a value
|
|
func ptr[T any](v T) *T {
|
|
return &v
|
|
}
|
|
|
|
// formatSSEMessage formats a Server-Sent Event message with proper CRLF line endings
|
|
func formatSSEMessage(event string, data []byte) string {
|
|
return fmt.Sprintf("event: %s\r\ndata: %s\r\n\r\n", event, string(data))
|
|
}
|