Skip to content

Commit 9cf0811

Browse files
fix(client): unmarshal stream events into fresh memory (#63)
1 parent bae4379 commit 9cf0811

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/jsonl/jsonl.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ func (s *Stream[T]) Next() bool {
3838
}
3939

4040
line := s.scn.Bytes()
41-
s.err = json.Unmarshal(line, &s.cur)
41+
var nxt T
42+
s.err = json.Unmarshal(line, &nxt)
43+
s.cur = nxt
4244
return s.err == nil
4345
}
4446

0 commit comments

Comments
 (0)