copilot-swe-agent[bot] d936a45bfd Fix SSE specification compliance - add space after colon in all SSE fields
Co-authored-by: appleboy <21979+appleboy@users.noreply.github.com>
2025-11-15 15:22:08 +00:00

25 lines
388 B
Go

package sse
import "io"
type stringWriter interface {
io.Writer
WriteString(string) (int, error)
}
type stringWrapper struct {
io.Writer
}
func (w stringWrapper) WriteString(str string) (int, error) {
return w.Write([]byte(str))
}
func checkWriter(writer io.Writer) stringWriter {
if w, ok := writer.(stringWriter); ok {
return w
} else {
return stringWrapper{writer}
}
}