We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c08602f commit 1ce7211Copy full SHA for 1ce7211
pkg/stream/parse.go
@@ -40,6 +40,14 @@ func ParseFile(filename string) error {
40
continue // skip lines without "data: "
41
}
42
43
+ // Handle special cases
44
+ if line == "[DONE]" {
45
+ break // stop processing if we encounter [DONE]
46
+ }
47
+ if line == "" {
48
+ continue // skip empty data lines
49
50
+
51
// Parse the JSON line into our `Data` struct
52
var data Data
53
err := json.Unmarshal([]byte(line), &data)
0 commit comments