Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v7
with:
go-version: "^1"
go-version: "1.26.10"

- name: Run lint
run: make install-tools lint
Expand All @@ -32,7 +32,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.26, 1.27]
go: ["1.26.10", 1.27]
include:
- os: ubuntu-latest
go-build: ~/.cache/go-build
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gin-contrib/sse

go 1.23
go 1.26.10

require github.com/stretchr/testify v1.11.1

Expand Down
2 changes: 1 addition & 1 deletion go.tools.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gin-contrib/sse/tools

go 1.26.0
go 1.26.10

tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint

Expand Down
3 changes: 1 addition & 2 deletions sse-decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ func (d *decoder) decode(r io.Reader) ([]Event, error) {
// Lines must be separated by either a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair,
// a single U+000A LINE FEED (LF) character,
// or a single U+000D CARRIAGE RETURN (CR) character.
lines := bytes.Split(buf, []byte{'\n'})
for _, line := range lines {
for line := range bytes.SplitSeq(buf, []byte{'\n'}) {
if len(line) == 0 {
// If the line is empty (a blank line). Dispatch the event.
d.dispatchEvent(currentEvent, dataBuffer.String())
Expand Down
Loading