Skip to content

Commit 7aa538b

Browse files
author
xiyuliu
committed
[chore] correct comments of EventSource.SetBody
1 parent f2b4edd commit 7aa538b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sse.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ func (es *EventSource) SetHeader(header, value string) *EventSource {
152152

153153
// SetBody method sets body value to the [EventSource] instance
154154
//
155-
// es.SetBody([]byte(`{"test":"put_data"}`),)
155+
// Example:
156+
// es.SetBody(bytes.NewReader([]byte(`{"test":"put_data"}`)))
156157
func (es *EventSource) SetBody(body io.Reader) *EventSource {
157158
es.body = body
158159
return es

0 commit comments

Comments
 (0)