Skip to content

Commit 14df9d2

Browse files
Update go/genkit/x/genkit.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 515159d commit 14df9d2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

go/genkit/x/genkit.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ func DefineStreamingFlow[In, Out, Stream any](g *genkit.Genkit, name string, fn
9292
for range discardCh {
9393
}
9494
}()
95-
output, err := fn(ctx, input, discardCh)
96-
close(discardCh)
97-
return output, err
95+
defer close(discardCh)
96+
return fn(ctx, input, discardCh)
9897
}
9998

10099
// Create a cancellable context for the user function.

0 commit comments

Comments
 (0)