kkdai / youtube

Download Youtube Video in Golang
MIT License
3.37k stars 433 forks source link

example_test.go: Close Stream #260

Closed AngangGuo closed 1 year ago

AngangGuo commented 2 years ago

According to the example from https://pkg.go.dev/github.com/kkdai/youtube/v2#example-Client.GetStream, the stream should be closed after finished download.

For [example_test.go[(https://github.com/kkdai/youtube/blob/master/example_test.go),, It's better to add defer stream.Close() at line 27.