Hi team,
|
for event := range output.GetStream().Events() { |
While this works perfectly for the CLI use case, Close() isn't called on the event stream. The SDK documentation notes this is required to clean up the underlying reader/writer.
If customers copy this snippet into a long-running web server (instead of a CLI), it will leak goroutines. Adding a defer stream.Close() would make this safe for copy-pasting into production apps.